# Postgresql (Peer Authentication Error) with Ansible 2.4

**URL:** <https://forum.ansible.com/t/postgresql-peer-authentication-error-with-ansible-2-4/27283>\
**Category:** Ansible Project\
**Created:** [April 15, 2018, 9:18am UTC](https://forum.ansible.com/t/postgresql-peer-authentication-error-with-ansible-2-4/27283 "2018-04-15T09:18:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bishwajit\_Samanta](https://avatars.discourse-cdn.com/v4/letter/b/8e7dd6/32.png) [@Bishwajit\_Samanta](https://forum.ansible.com/u/Bishwajit_Samanta)\
**Post date:** [April 15, 2018, 9:18am UTC](https://forum.ansible.com/t/postgresql-peer-authentication-error-with-ansible-2-4/27283/1 "2018-04-15T09:18:21Z")

</div>

Hi, i am having a problem in setting up postgresql through ansible.

Error::-

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [April 15, 2018, 9:44am UTC](https://forum.ansible.com/t/postgresql-peer-authentication-error-with-ansible-2-4/27283/2 "2018-04-15T09:44:46Z")

</div>

become and become\_user is directives for the task not the module, so they need to be align on the same level as postgres\_xxxx and name.

---

<div class="post-metadata">

**Author:** ![Bishwajit\_Samanta](https://avatars.discourse-cdn.com/v4/letter/b/8e7dd6/32.png) [@Bishwajit\_Samanta](https://forum.ansible.com/u/Bishwajit_Samanta)\
**Post date:** [April 15, 2018, 10:20am UTC](https://forum.ansible.com/t/postgresql-peer-authentication-error-with-ansible-2-4/27283/3 "2018-04-15T10:20:22Z")

</div>

Thanks Kai, that problem got solved. but after that 1 more problem created. Below is the error log. Now i am able to create database.

Error::-

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [April 15, 2018, 2:34pm UTC](https://forum.ansible.com/t/postgresql-peer-authentication-error-with-ansible-2-4/27283/4 "2018-04-15T14:34:32Z")

</div>

To me is looks like psycopg2 is missing some feature so you probably needs a new version of it.
