# mongodb\_user module seems to be not idempotent

**URL:** <https://forum.ansible.com/t/mongodb-user-module-seems-to-be-not-idempotent/26217>\
**Category:** Ansible Project\
**Created:** [December 7, 2017, 10:01am UTC](https://forum.ansible.com/t/mongodb-user-module-seems-to-be-not-idempotent/26217 "2017-12-07T10:01:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sebastien\_Latre](https://avatars.discourse-cdn.com/v4/letter/s/59ef9b/32.png) [@Sebastien\_Latre](https://forum.ansible.com/u/Sebastien_Latre)\
**Post date:** [December 7, 2017, 10:01am UTC](https://forum.ansible.com/t/mongodb-user-module-seems-to-be-not-idempotent/26217/1 "2017-12-07T10:01:39Z")

</div>

I’m working with Ansible 2.4.2.0 with Win7 as host and CentOs 6 as remote.

I’m trying to use mongodb\_user module to create mongo users.  
But without changing anything to the configuration, the task still reports as changed the next time.

`

- name: Create user  
mongodb\_user:  
database: “test”  
login\_host: “pocAnsible”  
login\_port: “27017”  
login\_user: “root”  
login\_password: “toto”  
user: “new\_user”  
password: “password”  
roles:
- db: “test”  
role: “read”  
`

I’m in update\_password: always policy which is supposed to be updated only when necessary according to the documentation  
[http://docs.ansible.com/ansible/latest/mongodb\_user\_module.html](http://docs.ansible.com/ansible/latest/mongodb_user_module.html)

Is it supposed to work as I expect or is there a bug in the module?

Thanks for your help on that.
