1
0
mirror of https://github.com/krislamo/puppet-acme_vault synced 2024-11-09 20:30:36 +00:00
puppet-acme_vault/manifests/deploy.pp

46 lines
1.1 KiB
ObjectPascal
Raw Normal View History

2018-02-22 19:46:51 +00:00
class acme_vault::deploy(
$user = $::acme_vault::params::user,
$group = $::acme_vault::params::group,
$home_dir = $::acme_vault::params::home_dir,
$cert_destination_path = $::acme_vault::params::cert_destination_path,
$domains = $::acme_vault::params::domains,
$restart = $::acme_vault::params::restart,
$restart_command = $::acme_vault::params::restart_command,
2018-02-22 19:46:51 +00:00
) inherits acme_vault::params {
include acme_vault::common
# copy down cert check script
file {"${home_dir}/check_cert.sh":
ensure => present,
owner => $user,
group => $group,
2018-02-26 19:54:07 +00:00
mode => '0750',
source => 'puppet:///modules/acme_vault/check_cert.sh',
}
if $restart {
2018-02-26 19:54:07 +00:00
$cron_command = "${home_dir}/check_cert.sh ${domain} ${cert_destination_path} && ${restart_command}"
} else {
2018-02-26 19:54:07 +00:00
$cron_command = "${home_dir}/check_cert.sh ${domain} ${cert_destination_path}"
}
notice($user)
$domains.each |$domain| {
cron { "${domain}_deploy":
2018-02-26 19:54:07 +00:00
command => $cron_command,
user => $user,
weekday => 2,
}
}
2018-02-22 19:46:51 +00:00
}