From 5180e29e2ff3507980aa6c1170ae6dd9778dc888 Mon Sep 17 00:00:00 2001 From: ace Date: Thu, 10 Aug 2023 18:36:37 +0300 Subject: [PATCH] fix initdb with custom user --- tasks/RedHat/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/RedHat/main.yaml b/tasks/RedHat/main.yaml index fe98415..f3268b3 100644 --- a/tasks/RedHat/main.yaml +++ b/tasks/RedHat/main.yaml @@ -46,7 +46,7 @@ when: postgresql_wal_g_restore_from_backup - name: PostgreSQL Initdb - shell: "/usr/pgsql-{{ postgresql_major_version }}/bin/postgresql-{{ postgresql_major_version }}-setup initdb --username {{ postgresql_superuser_username }} --auth-host {{ postgresql_password_encryption_algorithm }}" + shell: "PGSETUP_INITDB_OPTIONS='--username {{ postgresql_superuser_username }} --auth-host {{ postgresql_password_encryption_algorithm }}' /usr/pgsql-{{ postgresql_major_version }}/bin/postgresql-{{ postgresql_major_version }}-setup initdb" register: initdb changed_when: "'Data directory is not empty!' not in initdb.stdout" failed_when: false