diff --git a/roles/postgresql/tasks/main.yml b/roles/postgresql/tasks/main.yml index a5b644420..ca6196cc3 100644 --- a/roles/postgresql/tasks/main.yml +++ b/roles/postgresql/tasks/main.yml @@ -48,15 +48,21 @@ when: is_debuntu - name: Initialize the postgres db (debuntu) - command: su - postgres -c "/usr/lib/postgresql/{{ postgresql_version }}/bin/initdb -E 'UTF-8' --locale={{ postgresql_locale }} -D /library/pgsql-iiab" + #command: su - postgres -c "/usr/lib/postgresql/{{ postgresql_version }}/bin/initdb -E 'UTF-8' --locale={{ postgresql_locale }} -D /library/pgsql-iiab" + command: /usr/lib/postgresql/{{ postgresql_version }}/bin/initdb -E 'UTF-8' --locale={{ postgresql_locale }} -D /library/pgsql-iiab args: creates: /library/pgsql-iiab/pg_hba.conf + become: yes + become_user: postgres when: is_debuntu - name: Initialize the postgres db (OS's other than debuntu) - command: su - postgres -c "/usr/bin/initdb -E 'UTF-8' --lc-collate={{ postgresql_locale }} --lc-ctype={{ postgresql_locale }} -D /library/pgsql-iiab" + #command: su - postgres -c "/usr/bin/initdb -E 'UTF-8' --lc-collate={{ postgresql_locale }} --lc-ctype={{ postgresql_locale }} -D /library/pgsql-iiab" + command: /usr/bin/initdb -E 'UTF-8' --lc-collate={{ postgresql_locale }} --lc-ctype={{ postgresql_locale }} -D /library/pgsql-iiab args: creates: /library/pgsql-iiab/pg_hba.conf + become: yes + become_user: postgres when: not is_debuntu - name: Configure PostgreSQL