move some tasks to handlers
This commit is contained in:
parent
1cccde406c
commit
fff91c2995
2 changed files with 7 additions and 9 deletions
6
roles/dehydrated/handlers/main.yml
Normal file
6
roles/dehydrated/handlers/main.yml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
---
|
||||||
|
- name: dehydrated register
|
||||||
|
command: "{{ dehydrated_path }} --register --accept-terms"
|
||||||
|
|
||||||
|
- name: dehydrated cron
|
||||||
|
command: "{{ dehydrated_path }} --cron"
|
|
@ -24,18 +24,10 @@
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
src: /templates/config.j2
|
src: /templates/config.j2
|
||||||
dest: "{{ dehydrated_config }}/config"
|
dest: "{{ dehydrated_config }}/config"
|
||||||
register: dehyconfig
|
notify: dehydrated register
|
||||||
|
|
||||||
- name: Create wellknown directory.
|
- name: Create wellknown directory.
|
||||||
file:
|
file:
|
||||||
state: directory
|
state: directory
|
||||||
path: /var/www/letsencrypt
|
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
|
|
||||||
|
|
Loading…
Reference in a new issue