Implemented docker postgres draft

This commit is contained in:
2023-12-29 23:58:57 +01:00
parent 7f2d09d06a
commit 3181ce3def
3 changed files with 73 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
- name: Create Docker network for PostgreSQL
docker_network:
name: postgres_network
state: present
when: run_once_docker_postgres is not defined
- name: Install PostgreSQL
docker_container:
name: postgres
image: postgres:latest
detach: yes
env:
POSTGRES_PASSWORD: "{{ central_postgres_password }}"
networks:
- name: postgres_network
published_ports:
- "127.0.0.1:5432:5432"
when: run_once_docker_postgres is not defined
- name: Run the docker_postgres tasks once
set_fact:
run_once_docker_postgres: true
when: run_once_docker_postgres is not defined