Use proper boolean, stop timer when disabling

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2019-01-28 23:56:19 +01:00
parent a171ae9a44
commit 9040e13587
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E

View file

@ -66,13 +66,13 @@
- name: Enable docker-compose service - name: Enable docker-compose service
systemd: systemd:
name: docker-compose.service name: docker-compose.service
daemon_reload: yes daemon_reload: true
enabled: yes enabled: true
- name: Restart service if service configuration changed - name: Restart service if service configuration changed
systemd: systemd:
name: docker-compose.service name: docker-compose.service
daemon_reload: yes daemon_reload: true
state: restarted state: restarted
when: docker_compose_service.changed and packer_build_name is not defined when: docker_compose_service.changed and packer_build_name is not defined
@ -114,13 +114,13 @@
- name: Enable docker-compose-reload.timer - name: Enable docker-compose-reload.timer
systemd: systemd:
name: docker-compose-reload.timer name: docker-compose-reload.timer
daemon_reload: yes daemon_reload: true
enabled: yes enabled: true
- name: Restart docker-compose-reload.timer if it changed - name: Restart docker-compose-reload.timer if it changed
systemd: systemd:
name: docker-compose-reload.timer name: docker-compose-reload.timer
daemon_reload: yes daemon_reload: true
state: restarted state: restarted
when: docker_compose_reload_timer.changed and packer_build_name is not defined when: docker_compose_reload_timer.changed and packer_build_name is not defined
@ -174,22 +174,23 @@
- name: Enable docker-clean timer - name: Enable docker-clean timer
systemd: systemd:
name: docker-clean.timer name: docker-clean.timer
daemon_reload: yes daemon_reload: true
enabled: yes enabled: true
when: docker_compose_add_cleanjob when: docker_compose_add_cleanjob
- name: Restart docker-clean.timer if it changed - name: Restart docker-clean.timer if it changed
systemd: systemd:
name: docker-clean.timer name: docker-clean.timer
daemon_reload: yes daemon_reload: true
state: restarted state: restarted
when: docker_compose_clean_timer is defined and docker_compose_clean_timer.changed and packer_build_name is not defined and docker_compose_add_cleanjob when: docker_compose_clean_timer is defined and docker_compose_clean_timer.changed and packer_build_name is not defined and docker_compose_add_cleanjob
- name: Deactivate docker-clean timer - name: Deactivate docker-clean timer
systemd: systemd:
name: docker-clean.timer name: docker-clean.timer
daemon_reload: yes daemon_reload: true
enabled: no enabled: false
state: stopped
when: not docker_compose_add_cleanjob when: not docker_compose_add_cleanjob
- name: Uninstall docker-clean components - name: Uninstall docker-clean components