[CODE] caddy, cronmail: only run, if update needed

This commit is contained in:
Jannik Beyerstedt 2019-11-30 18:37:34 +01:00
parent 2d8903efeb
commit c0d2381824
4 changed files with 61 additions and 41 deletions

View file

@ -21,14 +21,17 @@
copy:
src: "{{ role_path }}/files/exim4.conf.template"
dest: /etc/exim4/exim4.conf.template
register: cronmails_conftmp_update
- name: cronmails - Copy exim4 config file
become: yes
template:
src: "{{ role_path }}/templates/update-exim4.conf.conf"
dest: /etc/exim4/update-exim4.conf.conf
register: cronmails_conffile_update
- name: cronmails - Run update-exim4.conf
become: yes
shell: "update-exim4.conf"
when: cronmails_conftmp_update.changed or cronmails_conffile_update.changed
- name: cronmails - Enable and start exim4
become: yes
service: