2024-09-09 22:37:51 +10:00
|
|
|
---
|
|
|
|
- name: Create directories
|
|
|
|
file:
|
|
|
|
path: "{{ item }}"
|
|
|
|
state: directory
|
|
|
|
with_items:
|
|
|
|
- "/mnt/nfs/docker/postgres"
|
|
|
|
- "/mnt/nfs/docker/postgres/config"
|
|
|
|
|
|
|
|
- name: Create the postgres container
|
|
|
|
docker_container:
|
|
|
|
name: postgres
|
2024-10-04 14:00:49 +10:00
|
|
|
image: postgres:17-alpine
|
2024-09-09 22:37:51 +10:00
|
|
|
restart_policy: unless-stopped
|
|
|
|
recreate: true
|
|
|
|
ports:
|
|
|
|
- 5432:5432
|
|
|
|
env:
|
|
|
|
POSTGRES_PASSWORD: "{{POSTGRES_PASSWORD}}"
|
|
|
|
volumes:
|
|
|
|
- /mnt/nfs/docker/postgres/db-data:/var/lib/postgresql/data
|
|
|
|
|