Skip to content

Commit

Permalink
Add support for hook literals in pillar
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-vant committed Dec 7, 2017
1 parent 5fed2b1 commit abd66d8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,12 @@ don't run as root, to move certs somewhere they can access:
- salt://path/to/deployhook1.sh
post:
- salt://path/to/posthook1.sh
# You can define hooks literally in pillar too
pillarhooks:
deploy:
deployhook1.sh: |
#!/bin/bash
echo "Triggered deploy hook"
Legacy configuration
--------------------
Expand Down
11 changes: 11 additions & 0 deletions letsencrypt/client/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,18 @@ certbot_renewal_{{ hookset }}_hook_{{ loop.index }}:
- mode: 700
- require:
- cmd: certbot_installed
{%- endfor %}
{%- endfor %}
{%- for hookset, hooks in client.get("pillarhooks", {}).items() %}
{%- for basename, script in hooks.items() %}
certbot_renewal_{{ hookset }}_phook_{{ loop.index }}:
file.managed:
- name: /etc/letsencrypt/renewal-hooks/{{ hookset }}/{{ basename }}
- contents_pillar: {{ script }}
- mode: 700
- require:
- cmd: certbot_installed
{%- endfor %}
{%- endfor %}
Expand Down

0 comments on commit abd66d8

Please sign in to comment.