Compare commits
3 Commits
9f236b6fa5
...
1.9.7
| Author | SHA1 | Date | |
|---|---|---|---|
| 621d5310a3 | |||
| 6377a56d95 | |||
| dbd72f43a4 |
@@ -177,7 +177,7 @@ version:
|
|||||||
vaultwarden: "1.35.4"
|
vaultwarden: "1.35.4"
|
||||||
gitea: "1.25.5"
|
gitea: "1.25.5"
|
||||||
redis: "8.6.1"
|
redis: "8.6.1"
|
||||||
immich: "v2.7.4"
|
immich: "v2.7.5"
|
||||||
actualbudget: "26.3.0"
|
actualbudget: "26.3.0"
|
||||||
paperless: "2.20.13"
|
paperless: "2.20.13"
|
||||||
vikunja: "2.2.2"
|
vikunja: "2.2.2"
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
- name: Reload postgresql
|
- name: Reload postgresql
|
||||||
ansible.builtin.command:
|
ansible.builtin.command:
|
||||||
/usr/bin/podman exec -u postgres postgresql sh -c "pg_ctl reload"
|
/usr/bin/podman exec -u postgres postgresql sh -c "pg_ctl reload"
|
||||||
when: not (is_postgresql_init_run | default(false))
|
when: is_postgresql_init.stat.exists
|
||||||
changed_when: false
|
changed_when: false
|
||||||
listen: "notification_reload_postgresql"
|
listen: "notification_reload_postgresql"
|
||||||
ignore_errors: true # noqa: ignore-errors
|
ignore_errors: true # noqa: ignore-errors
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
enabled: true
|
enabled: true
|
||||||
daemon_reload: true
|
daemon_reload: true
|
||||||
scope: "user"
|
scope: "user"
|
||||||
when: not (is_postgresql_init_run | default(false))
|
when: is_postgresql_init.stat.exists
|
||||||
changed_when: false
|
changed_when: false
|
||||||
listen: "notification_restart_postgresql"
|
listen: "notification_restart_postgresql"
|
||||||
ignore_errors: true # noqa: ignore-errors
|
ignore_errors: true # noqa: ignore-errors
|
||||||
|
|||||||
@@ -55,6 +55,8 @@
|
|||||||
no_log: true
|
no_log: true
|
||||||
|
|
||||||
- name: Initiate ldap (When = false, If DB data does not exist in postgresql, activate this block)
|
- name: Initiate ldap (When = false, If DB data does not exist in postgresql, activate this block)
|
||||||
|
# The reason why this task doesn't use the way to check ".init" file is this tasks can override original database.
|
||||||
|
# Absent of ".init" file cannot guarantee DB is empty.
|
||||||
when: false
|
when: false
|
||||||
become: true
|
become: true
|
||||||
block:
|
block:
|
||||||
|
|||||||
@@ -88,15 +88,13 @@
|
|||||||
no_log: true
|
no_log: true
|
||||||
|
|
||||||
- name: Check data directory empty
|
- name: Check data directory empty
|
||||||
ansible.builtin.find:
|
ansible.builtin.stat:
|
||||||
paths: "{{ node['home_path'] }}/containers/postgresql/data/"
|
path: "{{ node['home_path'] }}/containers/postgresql/data/.init"
|
||||||
hidden: true
|
|
||||||
file_type: "any"
|
|
||||||
become: true
|
become: true
|
||||||
register: "is_data_dir_empty"
|
register: "is_postgresql_init"
|
||||||
|
|
||||||
- name: Prepare initiating DB
|
- name: Prepare initiating DB
|
||||||
when: is_data_dir_empty.matched == 0
|
when: not is_postgresql_init.stat.exists
|
||||||
become: true
|
become: true
|
||||||
block:
|
block:
|
||||||
# `init/pg_cluster.sql` should be fetched from postgresql's backup directory before running initiating
|
# `init/pg_cluster.sql` should be fetched from postgresql's backup directory before running initiating
|
||||||
@@ -118,9 +116,14 @@
|
|||||||
loop: "{{ connected_services }}"
|
loop: "{{ connected_services }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
index_var: index_num
|
index_var: index_num
|
||||||
- name: Set is_postgresql_init_run
|
|
||||||
ansible.builtin.set_fact:
|
- name: Create .init file
|
||||||
is_postgresql_init_run: true
|
ansible.builtin.file:
|
||||||
|
path: "{{ node['home_path'] }}/containers/postgresql/data/.init"
|
||||||
|
state: "touch"
|
||||||
|
mode: "0644"
|
||||||
|
owner: "{{ ansible_user }}"
|
||||||
|
group: "svadmins"
|
||||||
|
|
||||||
- name: Deploy container file
|
- name: Deploy container file
|
||||||
ansible.builtin.template:
|
ansible.builtin.template:
|
||||||
|
|||||||
Reference in New Issue
Block a user