mirror of
https://github.com/krislamo/puppet-acme_vault
synced 2025-01-18 07:30:34 +00:00
fix cron conditional, common namespace fixes, domain template includes domain
This commit is contained in:
parent
8a09e270ce
commit
b8431548a7
@ -2,6 +2,7 @@ class acme_vault::common (
|
||||
$user = $::acme_vault::params::user,
|
||||
$group = $::acme_vault::params::group,
|
||||
$home_dir = $::acme_vault::params::home_dir,
|
||||
$domains = $::acme_vault::params::domains,
|
||||
$contact_email = $::acme_vault::params::contact_email,
|
||||
|
||||
$vault_token = $::acme_vault::params::vault_token,
|
||||
|
@ -1,10 +1,10 @@
|
||||
class acme_vault::deploy(
|
||||
$user = $::acme_vault::params::user,
|
||||
$group = $::acme_vault::params::group,
|
||||
$home_dir = $::acme_vault::params::home_dir,
|
||||
$user = $::acme_vault::common::user,
|
||||
$group = $::acme_vault::common::group,
|
||||
$home_dir = $::acme_vault::common::home_dir,
|
||||
$domains = $::acme_vault::common::domains,
|
||||
|
||||
$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,
|
||||
|
||||
@ -20,26 +20,29 @@ class acme_vault::deploy(
|
||||
source => 'puppet:///modules/acme_vault/check_cert.sh',
|
||||
}
|
||||
|
||||
if $restart {
|
||||
$cron_command = "${home_dir}/check_cert.sh ${domain} ${cert_destination_path} && ${restart_command}"
|
||||
} else {
|
||||
$cron_command = "${home_dir}/check_cert.sh ${domain} ${cert_destination_path}"
|
||||
# ensure destination path exists
|
||||
file {$cert_destination_path:
|
||||
ensure => directory,
|
||||
owner => $user,
|
||||
group => $group,
|
||||
mode => '0750',
|
||||
}
|
||||
|
||||
# cron job for deploy
|
||||
if $restart {
|
||||
$restart_suffix = "&& ${restart_command}"
|
||||
} else {
|
||||
$restart_suffix = ""
|
||||
}
|
||||
|
||||
notice($user)
|
||||
$domains.each |$domain| {
|
||||
$domains.each |$domain, $d_list| {
|
||||
cron { "${domain}_deploy":
|
||||
command => $cron_command,
|
||||
command => "${home_dir}/check_cert.sh ${domain} ${cert_destination_path} ${restart_suffix}",
|
||||
user => $user,
|
||||
weekday => 2,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,9 +1,10 @@
|
||||
class acme_vault::requestor (
|
||||
$user = $::acme_vault::params::user,
|
||||
$group = $::acme_vault::params::group,
|
||||
$home_dir = $::acme_vault::params::home_dir,
|
||||
$user = $::acme_vault::common::user,
|
||||
$group = $::acme_vault::common::group,
|
||||
$home_dir = $::acme_vault::common::home_dir,
|
||||
$contact_email = $::acme_vault::common::contact_email,
|
||||
$domains = $::acme_vault::common::domains,
|
||||
|
||||
$contact_email = $::acme_vault::params::contact_email,
|
||||
$staging = $::acme_vault::params::staging,
|
||||
$staging_url = $::acme_vault::params::staging_url,
|
||||
$prod_url = $::acme_vault::params::prod_url,
|
||||
@ -16,7 +17,6 @@ class acme_vault::requestor (
|
||||
$lexicon_username = $::acme_vault::params::lexicon_username,
|
||||
$lexicon_token = $::acme_vault::params::lexicon_token,
|
||||
|
||||
$domains = $::acme_vault::params::domains,
|
||||
|
||||
) inherits acme_vault::params {
|
||||
|
||||
|
@ -11,6 +11,7 @@
|
||||
<% } -%>
|
||||
--dns dns_lexicon \
|
||||
--dnssleep 600 \
|
||||
--domain "<%= $domain %>" \
|
||||
<% $domains.each |$d| { -%>
|
||||
--domain "<%= $d %>" \
|
||||
<% } -%>
|
||||
|
Loading…
Reference in New Issue
Block a user