Move pod-database to use zfs datasets
This commit is contained in:
parent
322cb15995
commit
3e5ee2a90e
@ -11,7 +11,7 @@ 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_postgresql-waldir:/var/lib/postgresql-waldir -e POSTGRES_INITDB_WALDIR=/var/lib/postgresql-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:/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
|
||||||
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
|
||||||
|
@ -6,9 +6,17 @@
|
|||||||
group: "{{ service_user_name }}"
|
group: "{{ service_user_name }}"
|
||||||
mode: 0755
|
mode: 0755
|
||||||
|
|
||||||
- name: Create data directory for user {{ service_user_name }}
|
- name: Create wal 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 }}/wal"
|
||||||
|
state: directory
|
||||||
|
owner: "{{ service_user_name }}"
|
||||||
|
group: "{{ service_user_name }}"
|
||||||
|
mode: 0755
|
||||||
|
|
||||||
|
- name: Create data directory for user {{ service_user_name }}
|
||||||
|
file:
|
||||||
|
path: "/var/lib/{{ ansible_hostname }}/data/{{ service_user_name }}/data"
|
||||||
state: directory
|
state: directory
|
||||||
owner: "{{ service_user_name }}"
|
owner: "{{ service_user_name }}"
|
||||||
group: "{{ service_user_name }}"
|
group: "{{ service_user_name }}"
|
||||||
|
@ -1,13 +1,20 @@
|
|||||||
- name: Create volume data dataset for user {{ service_user_name }}
|
- name: Create data dataset for user {{ service_user_name }}
|
||||||
zfs:
|
zfs:
|
||||||
name: rpool/var/lib/{{ ansible_hostname }}/data/{{ service_user_name }}
|
name: rpool/var/lib/{{ ansible_hostname }}/data/{{ service_user_name }}
|
||||||
state: present
|
state: present
|
||||||
|
extra_zfs_properties:
|
||||||
|
canmount: "off"
|
||||||
|
|
||||||
|
- name: Create wal dataset for user {{ service_user_name }}
|
||||||
|
zfs:
|
||||||
|
name: rpool/var/lib/{{ ansible_hostname }}/data/{{ service_user_name }}/wal
|
||||||
|
state: present
|
||||||
extra_zfs_properties:
|
extra_zfs_properties:
|
||||||
recordsize: "8K"
|
recordsize: "8K"
|
||||||
|
|
||||||
- name: Create data dataset for user {{ service_user_name }}
|
- name: Create data dataset for user {{ service_user_name }}
|
||||||
zfs:
|
zfs:
|
||||||
name: rpool/var/lib/{{ ansible_hostname }}/data/{{ service_user_name }}-data
|
name: rpool/var/lib/{{ ansible_hostname }}/data/{{ service_user_name }}/data
|
||||||
state: present
|
state: present
|
||||||
extra_zfs_properties:
|
extra_zfs_properties:
|
||||||
recordsize: "8K"
|
recordsize: "8K"
|
||||||
|
Loading…
Reference in New Issue
Block a user