2025-07-10 21:24:28 -06:00

23 lines
603 B
YAML

- name: Create data folder
ansible.builtin.file:
dest: "{{ docker_dir }}/{{ directory }}"
state: directory
owner: root
group: docker
mode: '0770'
recurse: yes
- name: Put up the postgres container
community.docker.docker_container:
name: "{{container_name}}"
image: postgres:17.4
restart_policy: always
state: started
pull: true
ports:
- "{{ port }}:5432"
env:
POSTGRES_USER: "{{ default_user }}"
POSTGRES_PASSWORD: "{{ default_password }}"
volumes:
- "{{ docker_dir }}/{{ directory }}/data:/var/lib/postgresql/data/"