From c924400ee0e85d9d39004dcd86b023e5759393ba Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Tue, 23 Jan 2018 11:44:43 +0100 Subject: [PATCH] Do not start services in packer builds Signed-off-by: Knut Ahlers --- tasks/main.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 405c12e..dae884b 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -76,19 +76,18 @@ WantedBy=docker.service register: docker_compose_service -- name: Start and enable docker-compose service +- name: Enable docker-compose service systemd: name: docker-compose.service daemon_reload: yes enabled: yes - state: started - name: Restart service if service configuration changed systemd: name: docker-compose.service daemon_reload: yes state: restarted - when: docker_compose_service.changed + when: docker_compose_service.changed and packer_build_name is not defined - name: Reload and apply configuration systemd: @@ -124,16 +123,15 @@ WantedBy=timers.target register: docker_compose_reload_timer -- name: Enable and start docker-compose-reload.timer +- name: Enable docker-compose-reload.timer systemd: name: docker-compose-reload.timer daemon_reload: yes enabled: yes - state: started - name: Restart docker-compose-reload.timer if it changed systemd: name: docker-compose-reload.timer daemon_reload: yes state: restarted - when: docker_compose_reload_timer.changed + when: docker_compose_reload_timer.changed and packer_build_name is not defined