0
0
mirror of https://github.com/saltstack-formulas/letsencrypt-sh-formula.git synced 2024-11-27 23:07:49 +01:00
letsencrypt-sh-formula/letsencrypt-sh/config.sls
Raphaël Hertzog 628e6bfef4 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.
2016-12-12 20:47:14 +01:00

41 lines
1.0 KiB
Plaintext

# -*- coding: utf-8 -*-
# vim: ft=sls
{% from "letsencrypt-sh/map.jinja" import letsencrypt_sh with context %}
{% set install_hook = False %}
{% if letsencrypt_sh.hook_script_src != 'salt://letsencrypt-sh/files/hook' or letsencrypt_sh.hook_service_to_reload %}
{% set install_hook = True %}
{% endif %}
letsencrypt-sh-config:
file.managed:
- name: {{ letsencrypt_sh.config_file }}
- source: salt://letsencrypt-sh/files/config
- mode: 644
- user: root
- group: root
- template: jinja
- context:
use_default_hook: {{ install_hook }}
{% if install_hook %}
letsencrypt-sh-hook:
file.managed:
- name: {{ letsencrypt_sh.hook_script }}
- source: {{ letsencrypt_sh.hook_script_src }}
- mode: 755
- user: root
- group: root
- template: jinja
{% endif %}
letsencrypt-sh-domains:
file.managed:
- name: {{ letsencrypt_sh.domains_txt }}
- source: salt://letsencrypt-sh/files/domains.txt
- mode: 644
- user: root
- group: root
- template: jinja