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