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: