I am trying to use a simple ansible playbook to
automate changing the root password. However, on 4 of my hosts, the
password is changed each time I run the playbook. So, with the simple playbook password.yml consisting of
---
- hosts: all
vars:
tasks:
- name: Change root password
user: name=root password='$6$salt$etcetc.'
Running this on selected hosts gives
# ansible-playbook password.yml -l host1,host2
PLAY [all] ********************************************************************
GATHERING FACTS ***************************************************************
ok: [host1]
ok: [host2]
TASK: [Change root password] **************************************************
ok: [host1]
changed: [host2]
PLAY RECAP ********************************************************************
host1 : ok=2 changed=0 unreachable=0 failed=0
host2 : ok=2 changed=1 unreachable=0 failed=0
No
matter how many times I run this, host2 is always changed - despite the
new encrypted password already being in the shadow file on host2 as it actually worked the first time I ran the playbook.
All
4 problems hosts are debian squeeze, but I have plenty of other debian
squeeze hosts that are working just fine - e.g. host1.