module not idempotent with sp_expire date string
Closed this issue · 1 comments
lqueryvg commented
Reported by @angystardust...
Module doesn't seem to respect the idempotency features of ansible.
In other words, every time I run an ad-hoc command using your module, it produces a change even if the configuration of the user is already applied:
[root@server ansible]# ansible -vvv as2-pre -M /srv/ansible/library/ -m chage -a 'user=user01 sp_expire=2016-07-01'
<10.220.20.134> ESTABLISH CONNECTION FOR USER: root on PORT 22 TO 10.220.20.134
<10.220.20.134> REMOTE_MODULE chage user=user01 sp_expire=2016-07-01
<10.220.20.134> EXEC /bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1465391877.86-60425506293546 && echo $HOME/.ansible/tmp/ansible-tmp-1465391877.86-60425506293546'
<10.220.20.134> PUT /tmp/tmpYHCt2s TO /root/.ansible/tmp/ansible-tmp-1465391877.86-60425506293546/chage
<10.220.20.134> EXEC /bin/sh -c 'LANG=C LC_CTYPE=C /usr/bin/env python /root/.ansible/tmp/ansible-tmp-1465391877.86-60425506293546/chage; rm -rf /root/.ansible/tmp/ansible-tmp-1465391877.86-60425506293546/ >/dev/null 2>&1'
as2-pre | success >> {
"changed": true,
"shadow": {
"sp_expire": "2016-07-01",
"sp_flag": "",
"sp_inact": "",
"sp_lstchg": "",
"sp_max": "99999",
"sp_min": "0",
"sp_nam": "user01",
"sp_pwd": "$1$Asnipsnipsnip97Lpf.HtIv/",
"sp_warn": "7"
}
}
[root@server ansible]# ansible -vvv as2-pre -M /srv/ansible/library/ -m chage -a 'user=user01 sp_expire=2016-07-01'
<10.220.20.134> ESTABLISH CONNECTION FOR USER: root on PORT 22 TO 10.220.20.134
<10.220.20.134> REMOTE_MODULE chage user=user01 sp_expire=2016-07-01
<10.220.20.134> EXEC /bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1465392323.15-105644358053577 && echo $HOME/.ansible/tmp/ansible-tmp-1465392323.15-105644358053577'
<10.220.20.134> PUT /tmp/tmpJJAOZT TO /root/.ansible/tmp/ansible-tmp-1465392323.15-105644358053577/chage
<10.220.20.134> EXEC /bin/sh -c 'LANG=C LC_CTYPE=C /usr/bin/env python /root/.ansible/tmp/ansible-tmp-1465392323.15-105644358053577/chage; rm -rf /root/.ansible/tmp/ansible-tmp-1465392323.15-105644358053577/ >/dev/null 2>&1'
as2-pre | success >> {
"changed": true,
"shadow": {
"sp_expire": "2016-07-01",
"sp_flag": "",
"sp_inact": "",
"sp_lstchg": "",
"sp_max": "99999",
"sp_min": "0",
"sp_nam": "user01",
"sp_pwd": "$1$Asnipsnipsnip97Lpf.HtIv/",
"sp_warn": "7"
}
}