From ab0b7835a4764411dc3cd9386d7f9bf3da10aea4 Mon Sep 17 00:00:00 2001 From: Sam Al-Sapti Date: Tue, 5 Dec 2023 22:08:55 +0100 Subject: [PATCH] Initialize database as postgres --- roles/postgresql/tasks/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/roles/postgresql/tasks/main.yml b/roles/postgresql/tasks/main.yml index 5f9101b..ee1a52a 100644 --- a/roles/postgresql/tasks/main.yml +++ b/roles/postgresql/tasks/main.yml @@ -54,6 +54,8 @@ ansible.builtin.command: cmd: /usr/pgsql-{{ postgresql_version }}/bin/postgresql-{{ postgresql_version }}-setup initdb creates: "{{ postgresql_pgdata }}/base" + become: true + become_user: postgres - name: Ensure PostgreSQL is enabled and running ansible.builtin.service: