cdist/cdist/conf/type/__letsencrypt_cert/gencode-remote

19 lines
377 B
Plaintext
Raw Normal View History

2017-10-31 13:08:36 +00:00
domain="$__object_id"
exists=$(cat "$__object/explorer/exists")
webroot="$(cat "$__object/parameter/webroot")"
admin_email="$(cat "$__object/parameter/admin-email")"
if [ -n "$exists" ]; then
exit 0
fi
cat <<EOF
if [ ! -d "$webroot" ]; then
2017-10-31 18:19:41 +00:00
mkdir -p "$webroot"
2017-10-31 13:08:36 +00:00
fi
certbot certonly -n --agree-tos --email '$admin_email' --quiet --webroot \
-w '$webroot' -d '$domain'
EOF