chore: sync staging workspace
This commit is contained in:
4
deployment/ansible/roles/traefik/defaults/main.yml
Normal file
4
deployment/ansible/roles/traefik/defaults/main.yml
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
traefik_stack_path: "{{ stacks_base_path }}/traefik"
|
||||
traefik_wait_timeout: "{{ wait_timeout | default(60) }}"
|
||||
traefik_wait_interval: 5
|
||||
23
deployment/ansible/roles/traefik/tasks/main.yml
Normal file
23
deployment/ansible/roles/traefik/tasks/main.yml
Normal file
@@ -0,0 +1,23 @@
|
||||
---
|
||||
- name: Deploy Traefik stack
|
||||
community.docker.docker_compose_v2:
|
||||
project_src: "{{ traefik_stack_path }}"
|
||||
state: present
|
||||
pull: always
|
||||
register: traefik_compose_result
|
||||
|
||||
- name: Check Traefik container status
|
||||
shell: |
|
||||
docker compose -f {{ traefik_stack_path }}/docker-compose.yml ps traefik | grep -Eiq "Up|running"
|
||||
register: traefik_state
|
||||
changed_when: false
|
||||
until: traefik_state.rc == 0
|
||||
retries: "{{ ((traefik_wait_timeout | int) + (traefik_wait_interval | int) - 1) // (traefik_wait_interval | int) }}"
|
||||
delay: "{{ traefik_wait_interval | int }}"
|
||||
failed_when: traefik_state.rc != 0
|
||||
when: not ansible_check_mode
|
||||
|
||||
- name: Record Traefik deployment facts
|
||||
set_fact:
|
||||
traefik_stack_changed: "{{ traefik_compose_result.changed | default(false) }}"
|
||||
traefik_log_hint: ""
|
||||
Reference in New Issue
Block a user