Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding possibility to provide challenge alias for signing certificates #11

Merged
merged 2 commits into from
Mar 3, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 18 additions & 4 deletions manifests/request.pp
Original file line number Diff line number Diff line change
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