User handlers to run when something changed
This commit is contained in:
parent
486216b8ff
commit
495f4c4343
2 changed files with 4 additions and 5 deletions
3
roles/mail_certificates/handlers/main.yml
Normal file
3
roles/mail_certificates/handlers/main.yml
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
---
|
||||||
|
- name: Generate certificates
|
||||||
|
command: "certbot certonly --non-interactive --config /etc/letsencrypt/conf.d/{{ certbot.certname }}.ini"
|
|
@ -21,8 +21,4 @@
|
||||||
src: "conf.ini.j2"
|
src: "conf.ini.j2"
|
||||||
dest: "/etc/letsencrypt/conf.d/{{ certbot.certname }}.ini"
|
dest: "/etc/letsencrypt/conf.d/{{ certbot.certname }}.ini"
|
||||||
mode: 0644
|
mode: 0644
|
||||||
register: certbot_config
|
notify: Generate certificates
|
||||||
|
|
||||||
- name: Generate new certificates if the configuration changed
|
|
||||||
command: "certbot certonly --non-interactive --config /etc/letsencrypt/conf.d/{{ certbot.certname }}.ini"
|
|
||||||
when: certbot_config.changed
|
|
||||||
|
|
Loading…
Reference in a new issue