From 9412cedba43319a18b9fd05ead36fd850d9aec26 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Sat, 23 Sep 2023 10:28:50 +0200 Subject: docker: move handlers to handlers/ --- roles/docker/handlers/main.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'roles/docker/handlers') diff --git a/roles/docker/handlers/main.yml b/roles/docker/handlers/main.yml index 742a98c..1810b19 100644 --- a/roles/docker/handlers/main.yml +++ b/roles/docker/handlers/main.yml @@ -1,7 +1,12 @@ -- name: Restart Docker +- name: Collect service facts + ansible.builtin.service_facts: + listen: docker_configured + +- name: Restart Docker service become: true + when: | + 'docker.service' in ansible_facts.services and ansible_facts.services['docker.service'].state == 'running' ansible.builtin.systemd_service: - daemon_reload: true name: docker state: restarted - listen: docker_restart + listen: docker_configured -- cgit v1.2.3