move some tasks to handlers

This commit is contained in:
David Kilias 2021-02-07 12:58:06 +01:00
parent 1cccde406c
commit fff91c2995
2 changed files with 7 additions and 9 deletions

View file

@ -0,0 +1,6 @@
---
- name: dehydrated register
command: "{{ dehydrated_path }} --register --accept-terms"
- name: dehydrated cron
command: "{{ dehydrated_path }} --cron"

View file

@ -24,18 +24,10 @@
ansible.builtin.template:
src: /templates/config.j2
dest: "{{ dehydrated_config }}/config"
register: dehyconfig
notify: dehydrated register
- name: Create wellknown directory.
file:
state: directory
path: /var/www/letsencrypt
- name: Register account.
command: "{{ dehydrated_path }} --register --accept-terms"
when: dehyconfig.changed
- name: Initial dehydrated run.
command: "{{ dehydrated_path }} --cron"
when: dehyconfig.changed