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
`