diff options
| author | Luke Hoersten <[email protected]> | 2024-02-04 20:27:19 -0600 |
|---|---|---|
| committer | Luke Hoersten <[email protected]> | 2024-02-04 20:27:19 -0600 |
| commit | 04edbf561c44e28753cbbaa3870b23b220cc644c (patch) | |
| tree | 66a1fc151e8036d6ee1d1de6401cfe9d619a82c1 /postgresql/tasks | |
| parent | e8be763403fb3d623b68ea6cb1781e61a72d28d4 (diff) | |
Tons of updates to fix migration to new server.
Diffstat (limited to 'postgresql/tasks')
| -rw-r--r-- | postgresql/tasks/main.yaml | 11 |
1 files changed, 11 insertions, 0 deletions
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" |
