mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-30 15:28:12 +02:00
Moved blocks to include_tasks to raise performance. Deploy was really slow
This commit is contained in:
22
roles/svc-db-postgres/tasks/01_core.yml
Normal file
22
roles/svc-db-postgres/tasks/01_core.yml
Normal file
@@ -0,0 +1,22 @@
|
||||
- name: Create Docker network for PostgreSQL
|
||||
docker_network:
|
||||
name: "{{ postgres_network_name }}"
|
||||
state: present
|
||||
ipam_config:
|
||||
- subnet: "{{ postgres_subnet }}"
|
||||
|
||||
- name: "include docker-compose role"
|
||||
include_role:
|
||||
name: docker-compose
|
||||
|
||||
- name: Wait for Postgres inside the container
|
||||
shell: "docker exec {{ postgres_name }} pg_isready -U postgres"
|
||||
register: pg_ready
|
||||
until: pg_ready.rc == 0
|
||||
retries: 30
|
||||
delay: 5
|
||||
|
||||
- name: install python-psycopg2
|
||||
pacman:
|
||||
name: python-psycopg2
|
||||
state: present
|
@@ -1,27 +1,5 @@
|
||||
- block:
|
||||
- name: Create Docker network for PostgreSQL
|
||||
docker_network:
|
||||
name: "{{ postgres_network_name }}"
|
||||
state: present
|
||||
ipam_config:
|
||||
- subnet: "{{ postgres_subnet }}"
|
||||
|
||||
- name: "include docker-compose role"
|
||||
include_role:
|
||||
name: docker-compose
|
||||
|
||||
- name: Wait for Postgres inside the container
|
||||
shell: "docker exec {{ postgres_name }} pg_isready -U postgres"
|
||||
register: pg_ready
|
||||
until: pg_ready.rc == 0
|
||||
retries: 30
|
||||
delay: 5
|
||||
|
||||
- name: install python-psycopg2
|
||||
pacman:
|
||||
name: python-psycopg2
|
||||
state: present
|
||||
|
||||
- include_tasks: 01_core.yml
|
||||
- include_tasks: utils/run_once.yml
|
||||
when: run_once_svc_db_postgres is not defined
|
||||
|
||||
@@ -31,5 +9,5 @@
|
||||
handler_role_name: "docker-compose"
|
||||
|
||||
- name: "Initialize database for '{{ database_name }}'"
|
||||
include_tasks: init.yml
|
||||
include_tasks: 02_init.yml
|
||||
when: "{{ postgres_init }}"
|
Reference in New Issue
Block a user