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

@@ -25,6 +25,21 @@
- gitlab-runner__etc_gitlab-runner
tags: ['docker_gitlab-runner']
- name: gitlab-runner | start service to create volumes
systemd:
name: docker-compose@gitlab-runner
state: started
when: not docker_services_external_volumes
tags: ['docker_gitlab-runner']
- name: gitlab-runner | wait for volumes to be created
wait_for:
path: /var/lib/docker/volumes/gitlab-runner__etc_gitlab-runner/_data
state: present
timeout: 20
when: not docker_services_external_volumes
tags: ['docker_gitlab-runner']
- name: gitlab-runner | configure config.toml
copy:
dest: '/var/lib/docker/volumes/gitlab-runner__etc_gitlab-runner/_data/config.toml'
@@ -58,7 +73,6 @@
{% if gitlab_runner_extra_hosts is defined %}
extra_hosts = [{% for host in gitlab_runner_extra_hosts %}"{{ host }}"{{ ", " if not loop.last else "" }}{% endfor %}]
{% endif %}
when: docker_services_external_volumes
notify: 'gitlab-runner-restart'
tags: ['docker_gitlab-runner']