start containers before pushing configurations when not using external volumes

This commit is contained in:
tom.chivert
2025-12-04 14:53:58 +01:00
parent 7218435b0a
commit c43a9f65e0
3 changed files with 47 additions and 6 deletions

View File

@@ -29,6 +29,21 @@
register: register_docker_volume_traefik__etc_traefik
tags: ['docker_traefik']
- name: traefik | start service to create volumes
systemd:
name: docker-compose@traefik
state: started
when: not docker_services_external_volumes
tags: ['docker_traefik']
- name: traefik | wait for volumes to be created
wait_for:
path: /var/lib/docker/volumes/traefik__etc_traefik/_data
state: present
timeout: 20
when: not docker_services_external_volumes
tags: ['docker_traefik']
- name: traefik | copy configuration file
template:
src: config/traefik/traefik.yml.j2
@@ -36,7 +51,6 @@
owner: root
group: root
mode: 0644
when: docker_services_external_volumes
notify: traefik-restart
tags: ['docker_traefik']
@@ -45,5 +59,4 @@
path: /var/lib/docker/volumes/traefik__etc_traefik/_data/dynamic
state: directory
mode: '0755'
when: docker_services_external_volumes
tags: ['docker_traefik']
tags: ['docker_traefik']