See https://bugs.launchpad.net/ubuntu/+source/shadow/+bug/1023509. You may want to test the behavior of userdel on those platforms and evaluate whether the fix is applied and working.
Strange, as it happens on both a Debian 6.0.6 and a Ubuntu 12.04 platform
Also, I didn’t see the output from ansible-playbook in this thread. You said it works, but gives warnings. Please provide specific output.
The first post has it:
2.) When I comment out the “authorized_key” action for that user, the user module returns this error:
“failed: [benelec.net] => {“failed”: true, “msg”: “userdel: warning: can’t remove /var/mail/harm: No such file or directory\n”, “name”: “harm”, “rc”: 12}”
But the full thing looks like this:
mark@xxxx:~/ansible/xxxx$ ansible-playbook -c ssh -K ./harm.yml
sudo password:
PLAY [xxxx] *********************
TASK: [Users beheren] *********************
failed: [xxxx.net] => {“failed”: true, “msg”: “userdel: warning: can’t remove /var/mail/harm: No such file or directory\n”, “name”: “harm”, “rc”: 12}
failed: [data.xxxx.net] => {“failed”: true, “msg”: “userdel: warning: can’t remove /var/mail/harm: No such file or directory\n”, “name”: “harm”, “rc”: 12}
failed: [tools.xxxx.net] => {“failed”: true, “msg”: “userdel: warning: can’t remove /var/mail/harm: No such file or directory\n”, “name”: “harm”, “rc”: 12}
failed: [www.xxxx.net] => {“failed”: true, “msg”: “userdel: warning: can’t remove /var/mail/harm: No such file or directory\n”, “name”: “harm”, “rc”: 12}
failed: [zimbra.xxxx.net] => {“failed”: true, “msg”: “userdel: warning: can’t remove /var/mail/harm: No such file or directory\n”, “name”: “harm”, “rc”: 12}
FATAL: all hosts have already failed – aborting
PLAY RECAP *********************
xxxx.net : ok=0 changed=0 unreachable=0 failed=1
data.xxxx.net : ok=0 changed=0 unreachable=0 failed=1
tools.xxxx.net : ok=0 changed=0 unreachable=0 failed=1
www.xxxx.net : ok=0 changed=0 unreachable=0 failed=1
zimbra.xxxx.net : ok=0 changed=0 unreachable=0 failed=1
And the yaml file:
mark@xxxxxx:~/ansible/xxxxxx$ cat ./harm.yml
vars:
user: mark
sudo: true
gather_facts: false
tasks:
action: user comment=Harm groups=sudo append=yes password=xxxxxx force=yes remove=yes name=harm state=absent
And finally the hosts in question:
mark@xxxxxx:~/ansible/xxxxxx$ ansible xxxxxx -c ssh -m command -a “cat /etc/issue”
xxxxxx.net | success | rc=0 >>
Debian GNU/Linux 6.0 \n \l
data.xxxxxx.net | success | rc=0 >>
Debian GNU/Linux 6.0 \n \l
tools.xxxxxx.net | success | rc=0 >>
Debian GNU/Linux 6.0 \n \l
www.xxxxxx.net | success | rc=0 >>
Debian GNU/Linux 6.0 \n \l
zimbra.xxxxxx.net | success | rc=0 >>
Ubuntu 12.04.1 LTS \n \l
Thanks,
Mark