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

@@ -32,12 +32,26 @@
register: 'register_docker_volume_gitlab_gitlab__run_secrets'
tags: ['docker_gitlab']
- name: gitlab | start service to create volumes
systemd:
name: docker-compose@gitlab
state: started
when: not docker_services_external_volumes
tags: ['docker_gitlab']
- name: gitlab | wait for volumes to be created
wait_for:
path: /var/lib/docker/volumes/gitlab__run_secrets/_data
state: present
timeout: 20
when: not docker_services_external_volumes
tags: ['docker_gitlab']
- name: 'gitlab | configure secret gitlab_root_password'
copy:
dest: '{{ register_docker_volume_gitlab_gitlab__run_secrets.volume.Mountpoint }}/gitlab_root_password'
dest: '{{ register_docker_volume_gitlab_gitlab__run_secrets.volume.Mountpoint if docker_services_external_volumes else "/var/lib/docker/volumes/gitlab__run_secrets/_data" }}/gitlab_root_password'
mode: '0600'
content: '{{ gitlab_root_password }}'
when: docker_services_external_volumes
ignore_errors: '{{ ansible_check_mode }}'
tags: ['docker_gitlab']