postgresql_user module: fe_sendauth: no password supplied

518 views
Skip to first unread message

Michael Shi

unread,
Dec 19, 2014, 12:57:46 AM12/19/14
to ansible...@googlegroups.com
I'm trying to use the postgresql_user module, but I keep getting unable to connect to database: fe_sendauth: no password supplied
Doing the same on postgresql_db module seems to work
Is it a problem authenticating as the postgres user?

# users.yml
- name: PostgreSQL | Make sure the PostgreSQL users are present
  postgresql_user:
    name: "{{item.name}}"
    password: "{{item.password | default('pass')}}"
    state: present
    login_host: "{{item.host | default('localhost')}}"
  with_items: postgresql_users
  when: postgresql_users|length > 0

# main.yml
- include: users.yml
  tags: [postgresql, postgresql-users]
  sudo: yes
  sudo_user: postgres

Michael Shi

unread,
Dec 20, 2014, 9:48:25 AM12/20/14
to ansible...@googlegroups.com
Any ideas anyone?

Brian Coca

unread,
Dec 22, 2014, 7:28:52 AM12/22/14
to ansible...@googlegroups.com
sudo_user: postgres should not require a password on normal setups as
it should use the local socket directly. Try setting it on the task
in users.yml instead of on the include.

--
Brian Coca
Reply all
Reply to author
Forward
0 new messages