From 04edbf561c44e28753cbbaa3870b23b220cc644c Mon Sep 17 00:00:00 2001 From: Luke Hoersten Date: Sun, 4 Feb 2024 20:27:19 -0600 Subject: Tons of updates to fix migration to new server. --- postgresql/tasks/main.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'postgresql/tasks') diff --git a/postgresql/tasks/main.yaml b/postgresql/tasks/main.yaml index 6195840..6efa491 100644 --- a/postgresql/tasks/main.yaml +++ b/postgresql/tasks/main.yaml @@ -22,6 +22,17 @@ group: "postgres" notify: restart postgres +- name: check if postgresql data dir is new + become: yes + find: path='{{postgresql_data_dir}}' + register: filesFound + +- name: initialize pg data dir + become: yes + become_user: "postgres" + command: "{{postgresql_initidb_path}} -D {{postgresql_data_dir}}" + when: filesFound == 0 + - name: ensure postgresql is started become: yes systemd: name="postgresql" enabled="yes" state="started" -- cgit v1.2.3