This commit is contained in:
Tobias J. Endres 2025-02-12 16:52:42 +01:00
parent 1086c62619
commit f05ee39688
3 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,3 @@
---
dependencies:
- role: postgres

View File

@ -0,0 +1,7 @@
---
postgres_container_name: postgres
postgres_port: 5432
postgres_user: tobi
postgres_password: risICE3
postgres_data_dir: /var/lib/postgresql/data/pgdata
postgres_volume: /opt/postgresData

View File

@ -0,0 +1,14 @@
---
- name: Run PostgreSQL Docker container
docker_container:
name: "{{ postgres_container_name }}"
image: postgres
state: started
ports:
- "{{ postgres_port }}:5432"
env:
POSTGRES_USER: "{{ postgres_user }}"
POSTGRES_PASSWORD: "{{ postgres_password }}"
PGDATA: "{{ postgres_data_dir }}"
volumes:
- "{{ postgres_volume }}:{{ postgres_data_dir }}"