2018-02-23 20:04:18 +00:00
|
|
|
#!/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_lexicon \
|
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
|
|
|
<% } -%>
|
2018-02-23 15:03:41 +00:00
|
|
|
> /dev/null && \
|
|
|
|
<%= $acme_script %> \
|
|
|
|
--deploy \
|
|
|
|
--domain <%= $domain %> \
|
|
|
|
--deploy-hook vault_cli
|