Move database mounts to use _data
This commit is contained in:
parent
581475c1fa
commit
1db7785dc4
@ -12,7 +12,22 @@ Environment=PODMAN_SYSTEMD_UNIT=%n
|
|||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
TimeoutStopSec=70
|
TimeoutStopSec=70
|
||||||
ExecStartPre=/bin/rm -f %t/container-database-postgres.pid %t/container-database-postgres.ctr-id
|
ExecStartPre=/bin/rm -f %t/container-database-postgres.pid %t/container-database-postgres.ctr-id
|
||||||
ExecStart=/usr/bin/podman run --conmon-pidfile %t/container-database-postgres.pid --cidfile %t/container-database-postgres.ctr-id --cgroups=no-conmon --pod-id-file %t/pod-database.pod-id --replace --label "io.containers.autoupdate=image" -dt -v /var/lib/yggdrasil/valkyrie-resolv.conf:/etc/resolv.conf:ro -v ./.config/pod-database/database.password:/run/secrets/database.password:ro -e POSTGRES_PASSWORD_FILE=/run/secrets/database.password -v /var/lib/yggdrasil/data/pod-database/wal:/var/lib/postgresql-wal -e POSTGRES_INITDB_WALDIR=/var/lib/postgresql-wal/waldir -v /var/lib/yggdrasil/data/pod-database/data:/var/lib/postgresql/data -e PGDATA=/var/lib/postgresql/data/pgdata --name=pod-database-postgres docker.io/library/postgres:15.0
|
ExecStart=/usr/bin/podman run \
|
||||||
|
--conmon-pidfile %t/container-database-postgres.pid \
|
||||||
|
--cidfile %t/container-database-postgres.ctr-id \
|
||||||
|
--cgroups=no-conmon \
|
||||||
|
--pod-id-file %t/pod-database.pod-id \
|
||||||
|
--replace \
|
||||||
|
--label "io.containers.autoupdate=image" \
|
||||||
|
-dt \
|
||||||
|
-v /var/lib/yggdrasil/valkyrie-resolv.conf:/etc/resolv.conf:ro \
|
||||||
|
-v ./.config/pod-database/database.password:/run/secrets/database.password:ro \
|
||||||
|
-e POSTGRES_PASSWORD_FILE=/run/secrets/database.password \
|
||||||
|
-v /var/lib/yggdrasil/data/pod-database/wal/_data:/var/lib/postgresql-wal \
|
||||||
|
-e POSTGRES_INITDB_WALDIR=/var/lib/postgresql-wal \
|
||||||
|
-v /var/lib/yggdrasil/data/pod-database/data/_data:/var/lib/postgresql/data \
|
||||||
|
--name=pod-database-postgres \
|
||||||
|
docker.io/library/postgres:15.0
|
||||||
ExecStop=/usr/bin/podman stop --ignore --cidfile %t/container-database-postgres.ctr-id -t 10
|
ExecStop=/usr/bin/podman stop --ignore --cidfile %t/container-database-postgres.ctr-id -t 10
|
||||||
ExecStopPost=/usr/bin/podman rm --ignore -f --cidfile %t/container-database-postgres.ctr-id
|
ExecStopPost=/usr/bin/podman rm --ignore -f --cidfile %t/container-database-postgres.ctr-id
|
||||||
PIDFile=%t/container-database-postgres.pid
|
PIDFile=%t/container-database-postgres.pid
|
||||||
|
@ -14,6 +14,14 @@
|
|||||||
group: "{{ service_user_name }}"
|
group: "{{ service_user_name }}"
|
||||||
mode: 0755
|
mode: 0755
|
||||||
|
|
||||||
|
- name: Create wal mount directory for user {{ service_user_name }}
|
||||||
|
file:
|
||||||
|
path: "/var/lib/{{ ansible_hostname }}/data/{{ service_user_name }}/wal/_data"
|
||||||
|
state: directory
|
||||||
|
owner: "{{ service_user_name }}"
|
||||||
|
group: "{{ service_user_name }}"
|
||||||
|
mode: 0755
|
||||||
|
|
||||||
- name: Create data directory for user {{ service_user_name }}
|
- name: Create data directory for user {{ service_user_name }}
|
||||||
file:
|
file:
|
||||||
path: "/var/lib/{{ ansible_hostname }}/data/{{ service_user_name }}/data"
|
path: "/var/lib/{{ ansible_hostname }}/data/{{ service_user_name }}/data"
|
||||||
@ -21,3 +29,11 @@
|
|||||||
owner: "{{ service_user_name }}"
|
owner: "{{ service_user_name }}"
|
||||||
group: "{{ service_user_name }}"
|
group: "{{ service_user_name }}"
|
||||||
mode: 0755
|
mode: 0755
|
||||||
|
|
||||||
|
- name: Create data mount directory for user {{ service_user_name }}
|
||||||
|
file:
|
||||||
|
path: "/var/lib/{{ ansible_hostname }}/data/{{ service_user_name }}/data/_data"
|
||||||
|
state: directory
|
||||||
|
owner: "{{ service_user_name }}"
|
||||||
|
group: "{{ service_user_name }}"
|
||||||
|
mode: 0755
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
group: "{{ service_user_name }}"
|
group: "{{ service_user_name }}"
|
||||||
mode: 0755
|
mode: 0755
|
||||||
|
|
||||||
- name: Create etc-letsencrypt/_data directory for user {{ service_user_name }}
|
- name: Create etc-letsencrypt mount directory for user {{ service_user_name }}
|
||||||
file:
|
file:
|
||||||
path: "/var/lib/{{ ansible_hostname }}/data/{{ service_user_name }}/etc-letsencrypt/_data"
|
path: "/var/lib/{{ ansible_hostname }}/data/{{ service_user_name }}/etc-letsencrypt/_data"
|
||||||
state: directory
|
state: directory
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
group: "{{ service_user_name }}"
|
group: "{{ service_user_name }}"
|
||||||
mode: 0755
|
mode: 0755
|
||||||
|
|
||||||
- name: Create etc-letsencrypt/_data directory for user {{ service_user_name }}
|
- name: Create etc-letsencrypt mount directory for user {{ service_user_name }}
|
||||||
file:
|
file:
|
||||||
path: "/var/lib/{{ ansible_hostname }}/data/{{ service_user_name }}/etc-letsencrypt/_data"
|
path: "/var/lib/{{ ansible_hostname }}/data/{{ service_user_name }}/etc-letsencrypt/_data"
|
||||||
state: directory
|
state: directory
|
||||||
|
Loading…
Reference in New Issue
Block a user