mirror of
https://github.com/saltstack-formulas/letsencrypt-sh-formula.git
synced 2026-10-08 05:39:46 +02:00
Add support for a default hook script
The default hook script can be used to reload the webserver when a new certificate has been installed.
This commit is contained in:
1 parent
f970909764
commit
628e6bfef4
6 files changed
+46
-1
No files matched your search
@@ -5,6 +5,9 @@
|
||||
'domains-txt': letsencrypt_sh.domains_txt,
|
||||
})
|
||||
-%}
|
||||
{%- if use_default_hook -%}
|
||||
{%- do cfg_client.setdefault('hook', letsencrypt_sh.hook_script) -%}
|
||||
{%- endif -%}
|
||||
{%- macro get_config(configname, default_value) -%}
|
||||
{%- set varname = configname.replace("-", "_") -%}
|
||||
{%- if configname in cfg_client -%}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
# File managed by Salt (salt://letsencrypt-sh/files/hook). Do not edit by
|
||||
# hand!
|
||||
|
||||
{% from "letsencrypt-sh/map.jinja" import letsencrypt_sh with context %}
|
||||
{% if letsencrypt_sh.hook_service_to_reload %}
|
||||
if [ "$1" = "deploy_cert" ]; then
|
||||
service {{ letsencrypt_sh.hook_service_to_reload }} reload
|
||||
fi
|
||||
{% else %}
|
||||
# Empty file because pillar letsencrypt-sh:lookup:hook_service_to_reload
|
||||
# was not set for this minion. Alternatively you can set
|
||||
# letsencrypt-sh:lookup:hook_script_src to point to another source
|
||||
# file.
|
||||
{% endif %}
|
||||
Reference in new issue
Block a user