Skip to content

Commit

Permalink
Merge pull request #11 from maartendq/master
Browse files Browse the repository at this point in the history
Adding possibility to provide challenge alias for signing certificates
  • Loading branch information
fraenki committed Mar 3, 2019
2 parents b3d425a + a8b081b commit e3fb0f9
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions manifests/request.pp
Expand Up @@ -122,12 +122,17 @@

# Collect additional options for acme.sh.
if ($profile['options']['dnssleep']) {
$_dnssleep = $profile['options']['dnssleep']
$_dnssleep = "--dnssleep ${profile['options']['dnssleep']}"
} else {
$_dnssleep = $::acme::params::dnssleep
$_dnssleep = "--dnssleep ${::acme::params::dnssleep}"
}

if ($profile['options']['challenge_alias']) {
$_challenge_alias = "--challenge-alias ${profile['options']['challenge_alias']}"
$acme_options = join([$_dnssleep, $_challenge_alias], ' ')
} else {
$acme_options = $_dnssleep
}
$_acme_options = [ "--dnssleep ${_dnssleep}" ]
$acme_options = join($_acme_options, ' ')

File {
owner => $user,
Expand All @@ -152,6 +157,13 @@
mode => '0640',
}

# Create directory to place the crt_file for each domain
$crt_dir_domain = "${crt_dir}/${domain}"
file { $crt_dir_domain :
ensure => directory,
mode => '0755',
}

# Places where acme.sh stores the resulting certificate.
$le_crt_file = "${acme_dir}/${domain}/${domain}.cer"
$le_chain_file = "${acme_dir}/${domain}/ca.cer"
Expand Down Expand Up @@ -258,6 +270,7 @@
User[$user],
Group[$group],
File[$csr_file],
File[$crt_dir_domain],
File[$account_conf_file],
Vcsrepo[$acme_install_dir],
],
Expand All @@ -284,6 +297,7 @@
User[$user],
Group[$group],
File[$csr_file],
File[$crt_dir_domain],
File[$account_conf_file],
Vcsrepo[$acme_install_dir],
],
Expand Down

0 comments on commit e3fb0f9

Please sign in to comment.