mirror of
https://github.com/saltstack-formulas/letsencrypt-sh-formula.git
synced 2024-11-27 23:07:49 +01:00
628e6bfef4
The default hook script can be used to reload the webserver when a new certificate has been installed.
41 lines
1.0 KiB
Plaintext
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
|