# How to fixed update\_password

**URL:** <https://forum.ansible.com/t/how-to-fixed-update-password/21817>\
**Category:** Ansible Project\
**Created:** [June 21, 2016, 3:04am UTC](https://forum.ansible.com/t/how-to-fixed-update-password/21817 "2016-06-21T03:04:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Lin](https://avatars.discourse-cdn.com/v4/letter/d/c77e96/32.png) [@Daniel\_Lin](https://forum.ansible.com/u/Daniel_Lin)\
**Post date:** [June 21, 2016, 3:04am UTC](https://forum.ansible.com/t/how-to-fixed-update-password/21817/1 "2016-06-21T03:04:42Z")

</div>

I got a problem, I use ansible user module, when i set update\_password: on\_create, it’s not work,still will update\_password everytime, my code is below, and anyone know how to fixed it ?

`

- name: Create Active User  
user:  
name: “{{ item }}”  
uid: “{{ management\_active\_users[item].uid | default(omit) }}”  
comment: “{{ management\_active\_users[item].full\_name | default(‘’) }}”  
createhome: “{{ management\_active\_users[item].createhome | default(‘yes’) }}”  
group: “{{ management\_active\_users[item].group | default(omit) }}”  
groups: “{{ management\_active\_users[item].groups | default(‘’) | join(‘,’) }}”  
shell: “{{ management\_active\_users[item].shell | default(‘/bin/bash’) }}”  
append: “{{ management\_active\_users[item].append | default(‘no’) }}”  
state: “{{ management\_active\_users[item].state | default(‘present’) }}”  
with\_items: “{{ management\_active\_users }}”  
when: management\_active\_users is defined

- name: Setup Active User Password  
user:  
name: “{{ item }}”  
password: “{{ user\_passwd | password\_hash(‘sha512’) }}”  
update\_password: on\_create

with\_items: “{{ management\_active\_users }}”  
when: management\_active\_users[item].password is defined

`
