chore: sync staging workspace
This commit is contained in:
23
deployment/ansible/roles/postgresql/tasks/main.yml
Normal file
23
deployment/ansible/roles/postgresql/tasks/main.yml
Normal file
@@ -0,0 +1,23 @@
|
||||
---
|
||||
- name: Deploy PostgreSQL stack
|
||||
community.docker.docker_compose_v2:
|
||||
project_src: "{{ postgresql_stack_path }}"
|
||||
state: present
|
||||
pull: always
|
||||
register: postgresql_compose_result
|
||||
|
||||
- name: Check PostgreSQL container status
|
||||
shell: |
|
||||
docker compose -f {{ postgresql_stack_path }}/docker-compose.yml ps postgres | grep -Eiq "Up|running"
|
||||
register: postgresql_state
|
||||
changed_when: false
|
||||
until: postgresql_state.rc == 0
|
||||
retries: "{{ ((postgresql_wait_timeout | int) + (postgresql_wait_interval | int) - 1) // (postgresql_wait_interval | int) }}"
|
||||
delay: "{{ postgresql_wait_interval | int }}"
|
||||
failed_when: postgresql_state.rc != 0
|
||||
when: not ansible_check_mode
|
||||
|
||||
- name: Record PostgreSQL deployment facts
|
||||
set_fact:
|
||||
postgresql_stack_changed: "{{ postgresql_compose_result.changed | default(false) }}"
|
||||
postgresql_log_hint: ""
|
||||
Reference in New Issue
Block a user