# User updated every single run

**URL:** <https://forum.ansible.com/t/user-updated-every-single-run/15323>\
**Category:** Ansible Project\
**Created:** [May 25, 2014, 3:27am UTC](https://forum.ansible.com/t/user-updated-every-single-run/15323 "2014-05-25T03:27:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Francisco\_Reyes](https://avatars.discourse-cdn.com/v4/letter/f/b77776/32.png) [@Francisco\_Reyes](https://forum.ansible.com/u/Francisco_Reyes)\
**Post date:** [May 25, 2014, 3:27am UTC](https://forum.ansible.com/t/user-updated-every-single-run/15323/1 "2014-05-25T03:27:54Z")

</div>

I have one machine that every time I run Ansible it keeps updating the same user.

No other machine has the problem. Thought maybe it was the user ended up somehow in an inconsistent state… Deleted the user, including it’s home directory.  
Did not help… same is still happening.

ansible 1.6 (devel ae29e43f93) last updated 2014/04/19 17:36:26 (GMT -400)

This is the task

- name: Create user in FreeBSD systems  
user: home=/home/{{item.uname}} name={{item.uname}} shell={{item.shell}} state=present password={{item.passwd}} groups=wheel  
when: ansible\_os\_family == “FreeBSD”  
with\_items: AdminUsers

This is the output from -vvv

TASK: [admin\_users | Create user in FreeBSD systems] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
\<10.1.1.95\> ESTABLISH CONNECTION FOR USER: root  
\<10.1.1.95\> REMOTE\_MODULE user home=/home/francisco name=francisco shell=/usr/local/bin/zsh state=present password=VALUE\_HIDDEN groups=wheel  
\<10.1.1.95\> EXEC [‘ssh’, ‘-C’, ‘-tt’, ‘-vvv’, ‘-o’, ‘ControlMaster=auto’, ‘-o’, ‘ControlPersist=60s’, ‘-o’, ‘ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r’, ‘-o’, ‘Port=2222’, ‘-o’, ‘KbdInteractiveAuthentication=no’, ‘-o’, ‘PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey’, ‘-o’, ‘PasswordAuthentication=no’, ‘-o’, ‘ConnectTimeout=10’, ‘10.1.1.95’, “/bin/sh -c ‘mkdir -p $HOME/.ansible/tmp/ansible-tmp-1401002098.12-52400671984647 && echo $HOME/.ansible/tmp/ansible-tmp-1401002098.12-52400671984647’”]  
\<10.1.1.95\> PUT /tmp/tmpchs1V7 TO /root/.ansible/tmp/ansible-tmp-1401002098.12-52400671984647/user  
\<10.1.1.95\> EXEC [‘ssh’, ‘-C’, ‘-tt’, ‘-vvv’, ‘-o’, ‘ControlMaster=auto’, ‘-o’, ‘ControlPersist=60s’, ‘-o’, ‘ControlPath=/root/.ansible/cp/ansible-ssh-%h-%p-%r’, ‘-o’, ‘Port=2222’, ‘-o’, ‘KbdInteractiveAuthentication=no’, ‘-o’, ‘PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey’, ‘-o’, ‘PasswordAuthentication=no’, ‘-o’, ‘ConnectTimeout=10’, ‘10.1.1.95’, “/bin/sh -c ‘/usr/local/bin/python2.7 /root/.ansible/tmp/ansible-tmp-1401002098.12-52400671984647/user; rm -rf /root/.ansible/tmp/ansible-tmp-1401002098.12-52400671984647/ \>/dev/null 2\>&1’”]  
changed: [[pull.natserv.net](http://pull.natserv.net)] =\> (item={‘passwd’: ‘$6$rounds=100000$uXRZS5W3uZSr0E8i$14subthKb62fHlNq61.cjs1xvrcHX/9Whk4jxT.jBybZsGb3IQTLudQbmYnc192wok0HMVosWyZ3Szdkpmv0t.’, ‘uname’: ‘francisco’, ‘shell’: ‘/usr/local/bin/zsh’, ‘francisco’: None}) =\> {“append”: false, “changed”: true, “comment”: “User &”, “group”: 1001, “groups”: “wheel”, “home”: “/home/francisco”, “item”: {“francisco”: null, “passwd”: “$6$rounds=100000$uXRZS5W3uZSr0E8i$14subthKb62fHlNq61.cjs1xvrcHX/9Whk4jxT.jBybZsGb3IQTLudQbmYnc192wok0HMVosWyZ3Szdkpmv0t.”, “shell”: “/usr/local/bin/zsh”, “uname”: “francisco”}, “move\_home”: false, “name”: “francisco”, “password”: “NOT\_LOGGING\_PASSWORD”, “shell”: “/usr/local/bin/zsh”, “state”: “present”, “uid”: 1001}

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [May 25, 2014, 8:59pm UTC](https://forum.ansible.com/t/user-updated-every-single-run/15323/2 "2014-05-25T20:59:59Z")

</div>

The bit that returns “changed” may not be fully cognizant of all the parameters.

I’m pretty sure password is one of those attributes, in changing the password, it may report changed every time.

Are you just trying to get the status to report changed=0 or are there updates you don’t want to happen? If so, please specify which.

---

<div class="post-metadata">

**Author:** ![Francisco\_Reyes](https://avatars.discourse-cdn.com/v4/letter/f/b77776/32.png) [@Francisco\_Reyes](https://forum.ansible.com/u/Francisco_Reyes)\
**Post date:** [May 25, 2014, 9:08pm UTC](https://forum.ansible.com/t/user-updated-every-single-run/15323/3 "2014-05-25T21:08:31Z")

</div>

> The bit that returns “changed” may not be fully cognizant of all the parameters.  
> I’m pretty sure password is one of those attributes, in changing the password, it may report changed every time.

But if that was the case shouldn’t this happen to other hosts? This is the only host that has that behavior.  
i have several other FreeBSD machines in the same host group and none of them has, or has ever had, that behavior. Even this same machine didn’t have this behavior before.

> Are you just trying to get the status to report changed=0

Ideally yes…

> or are there updates you don’t want to happen? If so, please specify which.

As far as I can tell the task is working fine and doing exactly what it should be doing. The user exists, the key is installed, the password is correct…

Tried deleting the user (twice) including deleting the home folder. Both times the user got re-created properly.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [May 25, 2014, 9:18pm UTC](https://forum.ansible.com/t/user-updated-every-single-run/15323/4 "2014-05-25T21:18:02Z")

</div>

If you can do some debugging using the “test\_module” script and determine _why_ this one host is reporting changed every time it may be helpful.

I’d say file a ticket but it seems like it may be hard to reproduce if it’s just this one host – maybe something else is modifying it? (Had to ask)

---

<div class="post-metadata">

**Author:** ![Francisco\_Reyes](https://avatars.discourse-cdn.com/v4/letter/f/b77776/32.png) [@Francisco\_Reyes](https://forum.ansible.com/u/Francisco_Reyes)\
**Post date:** [May 25, 2014, 9:34pm UTC](https://forum.ansible.com/t/user-updated-every-single-run/15323/5 "2014-05-25T21:34:09Z")

</div>

> If you can do some debugging using the “test\_module” script and determine _why_ this one host is reporting changed every time it may be helpful.

This one [https://github.com/ansible/ansible/blob/devel/hacking/test-module](https://github.com/ansible/ansible/blob/devel/hacking/test-module) ?  
Any links/documentation on how to run it?

> I’d say file a ticket

Trying to at least provide more info before doing a ticket… otherwise it may not be of much help… if it is something that only happens, reliably, in a single machine…

> maybe something else is modifying it? (Had to ask)

Don’t believe that to be the case. Specially when I would literally re-run the process several times after each other. Can’t imagine anyhing that would e changing my user files/password that quickly… plus I am the only person that uses the machine in any form of regular bases.

---

<div class="post-metadata">

**Author:** ![James\_Cammarata](https://avatars.discourse-cdn.com/v4/letter/j/7c8e57/32.png) [@James\_Cammarata](https://forum.ansible.com/u/James_Cammarata)\
**Post date:** [May 26, 2014, 12:07am UTC](https://forum.ansible.com/t/user-updated-every-single-run/15323/6 "2014-05-26T00:07:58Z")

</div>

Another user had opened an issue for a very similar error, however it turned out to be something in their environment. My suggestion to them was to compare the output of “getent passwd ” before and after a run to see what it might be changing each time. Beyond that, it might be something home directory related, perhaps caused by some other part of the play?
