1
0
mirror of https://github.com/krislamo/puppet-acme_vault synced 2024-09-19 20:40:36 +00:00
puppet-acme_vault/templates/domain.epp

42 lines
974 B
Plaintext
Raw Normal View History

#!/bin/bash
. ${HOME}/.bashrc
2018-02-22 19:46:51 +00:00
<%= $acme_script %> \
--issue \
<% if $staging { -%>
--staging \
--server <%= $staging_url %> \
<% } else { -%>
2019-08-08 16:01:55 +00:00
--server <%= $prod_url %> \
2018-02-22 19:46:51 +00:00
<% } -%>
--dns dns_namecheap \
2019-08-08 16:01:55 +00:00
--dnssleep 1800 \
--domain "<%= $domain %>" --challenge-alias <%= "$domain" %> \
<% $domains.each |$d| {
# this uses the challenge-alias override if specified, otherwise
# uses the sld.tld of the given domain
if $overrides[$d] {
$ca = $overrides[$d]
}
else {
# we need to calculate the challenge-alias
$ds = split($d, '[.]')
# we don't want to count the wildcard, so strip it off
if $ds[0] == "*" {
$clean = $ds[1, -1]
}
else {
$clean = $ds[0, -1]
}
$ca = join($clean, ".")
}
-%>
--domain "<%= $d %>" --challenge-alias <%= "${ca}" %> \
2018-02-22 19:46:51 +00:00
<% } -%>
> /dev/null && \
<%= $acme_script %> \
--deploy \
--domain <%= $domain %> \
--deploy-hook vault_cli