Hello All,
I’m using ansible with a lot of managed docker images, and I’m searching a way to have a single handler for all my tasks, at least reduce my list of handlers …
Something like this (pseudo code)
Handler
- name: Run specific service docker compose
docker_compose:
project_src: "/opt/docker"
services: "{{ variable }}"
build: yes
pull: yes
state: present
restarted: yes
Task
- name: Set config runner2
vars:
variable: mycontainer
template:
src: runner2/config.toml
dest: "/opt/docker/runner2/config.toml"
owner: root
group: docker
mode: 0640
tags: rundocker
notify: Run specific service docker compose
When the file config.toml is changed only “mycontainer” is restarted
Any ideas would be appreciated
Thanks !