add default user custom name support

This commit is contained in:
ace 2023-06-13 21:29:53 +03:00
parent d0cf0cc32f
commit a20385be58
Signed by: ace
GPG Key ID: 2C08973DD37A76FD
2 changed files with 2 additions and 2 deletions

View File

@ -18,7 +18,7 @@
- name: "PostgreSQL initdb"
become_user: "{{ postgresql_superuser_username }}"
shell: "/usr/lib/postgresql/{{ postgresql_major_version }}/bin/initdb -D {{ postgresql_data_dir }} --auth-local peer --auth-host {{ postgresql_password_encryption_algorithm }} --no-instructions"
shell: "/usr/lib/postgresql/{{ postgresql_major_version }}/bin/initdb -D {{ postgresql_data_dir }} --username {{ postgresql_superuser_username }} --auth-local peer --auth-host {{ postgresql_password_encryption_algorithm }} --no-instructions"
register: initdb
changed_when: "'exists but is not empty' not in initdb.stderr"
failed_when: false

View File

@ -42,7 +42,7 @@
when: postgresql_wal_g_restore
- name: PostgreSQL Initdb
shell: "/usr/pgsql-{{ postgresql_major_version }}/bin/postgresql-{{ postgresql_major_version }}-setup initdb"
shell: "/usr/pgsql-{{ postgresql_major_version }}/bin/postgresql-{{ postgresql_major_version }}-setup initdb --username {{ postgresql_superuser_username }} --auth-host {{ postgresql_password_encryption_algorithm }}"
register: initdb
changed_when: "'Data directory is not empty!' not in initdb.stdout"
failed_when: false