aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/roles/docker/tasks/main.yml
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2023-08-31 23:13:51 +0200
committerEgor Tensin <Egor.Tensin@gmail.com>2023-08-31 23:17:51 +0200
commit003c4d40b0900c025192ba8e6332f7c0e5cd8a12 (patch)
treee9f5a936604257a9139dac7c967cdcc53461cce0 /roles/docker/tasks/main.yml
parentv0.0.24 (diff)
downloadinfra-ansible-003c4d40b0900c025192ba8e6332f7c0e5cd8a12.tar.gz
infra-ansible-003c4d40b0900c025192ba8e6332f7c0e5cd8a12.zip
docker: factor out service restart as a handler
Diffstat (limited to '')
-rw-r--r--roles/docker/tasks/main.yml13
1 files changed, 9 insertions, 4 deletions
diff --git a/roles/docker/tasks/main.yml b/roles/docker/tasks/main.yml
index c8361a0..639615b 100644
--- a/roles/docker/tasks/main.yml
+++ b/roles/docker/tasks/main.yml
@@ -5,7 +5,16 @@
name:
- docker.io
- docker-compose
+ policy_rc_d: 101
state: present
+ notify: docker_restart
+
+- name: Configure Docker logging driver
+ when: docker_logging_driver is defined and docker_logging_driver
+ ansible.builtin.include_tasks: logging.yml
+
+- name: Restart systemd service if necessary
+ ansible.builtin.meta: flush_handlers
- name: Clean up Docker data
become: true
@@ -17,7 +26,3 @@
networks: true
volumes: true
builder_cache: true
-
-- name: Configure Docker logging driver
- when: docker_logging_driver is defined and docker_logging_driver
- ansible.builtin.include_tasks: logging.yml