Re: Initial Postgres admin account setup using Ansible? - Mailing list pgsql-general

From Nick
Subject Re: Initial Postgres admin account setup using Ansible?
Date
Msg-id d1c0911f37c15ca63626326bf029dff308cc21a1.camel@ageofdream.com
Whole thread Raw
In response to Re: Initial Postgres admin account setup using Ansible?  ("Andreas 'ads' Scherbaum" <adsmail@wars-nicht.de>)
List pgsql-general
On Tue, 2024-12-31 at 23:16 +0100, Andreas 'ads' Scherbaum wrote:
>
>
>
> Can you please provide an example of the task(s) which fail?
> If you have passwordless "sudo" configured tor the user running
> Ansible,
> this works:
>
> - name: Ping PostgreSQL
>   postgresql_ping:
>   db: postgres
>   login_unix_socket: "/var/run/postgresql"
>   login_user: postgres
>   become: yes
>   become_user: postgres
>  
> More examples and details:
> https://andreas.scherbaum.la/writings/Managing_PostgreSQL_with_Ansible_-_Percona_Live_2022.pdf
>
>

When trying this:

- name: Ping PostgreSQL
  postgresql_ping:
    db: postgres
    login_unix_socket: "/var/run/postgresql"
    login_user: postgres
  become: yes
  become_user: postgres


I get:

Ping PostgreSQL...
  xxx.xxx.xxx.xxx failed | msg: Failed to set permissions on the
temporary files Ansible needs to create when becoming an unprivileged
user (rc: 1, err: chmod: invalid mode: ‘A+user:postgres:rx:allow’
Try 'chmod --help' for more information.
}). For information on working around this, see

https://docs.ansible.com/ansible-core/2.17/playbook_guide/playbooks_privilege_escalation.html#risks-of-becoming-an-unprivileged-user






pgsql-general by date:

Previous
From: "Andreas 'ads' Scherbaum"
Date:
Subject: Re: Initial Postgres admin account setup using Ansible?
Next
From: Nick
Date:
Subject: Re: Initial Postgres admin account setup using Ansible?