Re: Initial Postgres admin account setup using Ansible?

From: Nick <lists2(at)ageofdream(dot)com>
To: Andreas 'ads' Scherbaum <adsmail(at)wars-nicht(dot)de>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Initial Postgres admin account setup using Ansible?
Date: 2024-12-31 22:22:08
Message-ID: d1c0911f37c15ca63626326bf029dff308cc21a1.camel@ageofdream.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Nick 2025-01-01 00:17:07 Re: Initial Postgres admin account setup using Ansible?
Previous Message Andreas 'ads' Scherbaum 2024-12-31 22:16:46 Re: Initial Postgres admin account setup using Ansible?