# Problem creating postgresql user

**URL:** <https://forum.ansible.com/t/problem-creating-postgresql-user/29871>\
**Category:** Ansible Project\
**Created:** [March 13, 2019, 5:43am UTC](https://forum.ansible.com/t/problem-creating-postgresql-user/29871 "2019-03-13T05:43:40Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joshua\_J\_Kugler](https://avatars.discourse-cdn.com/v4/letter/j/ecc23a/32.png) [@Joshua\_J\_Kugler](https://forum.ansible.com/u/Joshua_J_Kugler)\
**Post date:** [March 13, 2019, 5:43am UTC](https://forum.ansible.com/t/problem-creating-postgresql-user/29871/1 "2019-03-13T05:43:40Z")

</div>

I have this stanza:

&nbsp;&nbsp;&nbsp;&nbsp;- name: Create redmine user  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;postgresql\_user:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;name: redmine  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;password: "ZZZ"  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;expires: infinity  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;become: true  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;become\_user: postgres

It runs. The user is created. But regardless of what value I put in the  
password field, the md5 hash comes out as

md5bbc5416c08a022eda40297f11f548594

That "bbc5416...." is certainly not what I get when hashing my password, and  
like I said, I get that value regardless of what password I use. Even if I set  
the password to an md5 hash value starting with "md5," it still ends up as  
"md5bbc5416...."

What am I doing wrong? How can I go about debugging this?

Thanks!

j

---

<div class="post-metadata">

**Author:** ![Sudheer\_S1](https://avatars.discourse-cdn.com/v4/letter/s/e99b99/32.png) [@Sudheer\_S1](https://forum.ansible.com/u/Sudheer_S1)\
**Post date:** [March 13, 2019, 5:52am UTC](https://forum.ansible.com/t/problem-creating-postgresql-user/29871/2 "2019-03-13T05:52:14Z")

</div>

The documentation says this for the password parameter:

---

<div class="post-metadata">

**Author:** ![Joshua\_J\_Kugler](https://avatars.discourse-cdn.com/v4/letter/j/ecc23a/32.png) [@Joshua\_J\_Kugler](https://forum.ansible.com/u/Joshua_J_Kugler)\
**Post date:** [March 13, 2019, 5:35pm UTC](https://forum.ansible.com/t/problem-creating-postgresql-user/29871/3 "2019-03-13T17:35:14Z")

</div>

Yes, I am aware of what the documentation says. I've read it several times  
trying to figure out what is wrong. 🙂 Please read my question again:  
\*regardless\* of what value I specify for my password, the hash ends up the  
same, and I cannot log in using the password I just created for that user.

j

---

<div class="post-metadata">

**Author:** ![Joshua\_J\_Kugler1](https://avatars.discourse-cdn.com/v4/letter/j/c5a1d2/32.png) [@Joshua\_J\_Kugler1](https://forum.ansible.com/u/Joshua_J_Kugler1)\
**Post date:** [March 14, 2019, 5:55am UTC](https://forum.ansible.com/t/problem-creating-postgresql-user/29871/4 "2019-03-14T05:55:36Z")

</div>

Yes, I'm including full passwords.  
1) this is vm on local machine; will change before prod  
2) You can use them in your debugging so you can use the same username/  
password pairs that I do.

&nbsp;&nbsp;&nbsp;&nbsp;- name: Create redmine user  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;postgresql\_user:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;name: redmine  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;password: "hague9Tendon=table7Narrow6house6"  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;expires: infinity  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;become: true  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;become\_user: postgres

postgres=# select rolname,rolpassword from pg\_authid;  
rolname | rolpassword

---

<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:** [March 14, 2019, 7:00am UTC](https://forum.ansible.com/t/problem-creating-postgresql-user/29871/5 "2019-03-14T07:00:59Z")

</div>

> Yes, I'm including full passwords.  
> 1) this is vm on local machine; will change before prod

I startet a LXC with Postgresql 10.6 and uses Ansible 2.7.8 with psycopg2 2.7.4

> 2) You can use them in your debugging so you can use the same username/  
> password pairs that I do.
> 
> &nbsp;&nbsp;&nbsp;&nbsp;- name: Create redmine user  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;postgresql\_user:  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;name: redmine  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;password: "hague9Tendon=table7Narrow6house6"  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;expires: infinity  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;become: true  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;become\_user: postgres
> 
> postgres=# select rolname,rolpassword from pg\_authid;  
> rolname | rolpassword  
> ----------+-------------------------------------  
> postgres |  
> redmine | md5bbc5416c08a022eda40297f11f548594  
> (2 rows)

I run the same task an get this

postgres=# select rolname,rolpassword from pg\_authid where rolname='redmine';  
&nbsp;&nbsp;rolname | rolpassword

---

<div class="post-metadata">

**Author:** ![Joshua\_J\_Kugler1](https://avatars.discourse-cdn.com/v4/letter/j/c5a1d2/32.png) [@Joshua\_J\_Kugler1](https://forum.ansible.com/u/Joshua_J_Kugler1)\
**Post date:** [March 14, 2019, 5:10pm UTC](https://forum.ansible.com/t/problem-creating-postgresql-user/29871/6 "2019-03-14T17:10:23Z")

</div>

I am running Ansible 2.7.8 as well. ☹

Glad to hear it worked for you. If only I could figure out why it's not  
working for me.

j

---

<div class="post-metadata">

**Author:** ![Joshua\_J\_Kugler](https://avatars.discourse-cdn.com/v4/letter/j/ecc23a/32.png) [@Joshua\_J\_Kugler](https://forum.ansible.com/u/Joshua_J_Kugler)\
**Post date:** [March 14, 2019, 9:48pm UTC](https://forum.ansible.com/t/problem-creating-postgresql-user/29871/7 "2019-03-14T21:48:59Z")

</div>

Well, here I am...to apologize for wasting everyone's time. I was importing a  
DB dump, and I didn't realize it was recreating users from the old server as  
well.

We can close this thread. Sorry for the noise.

j
