I'm still new to Ansible, but over the past couple days I've been trying to use it to setup a couple new vm's. I start by cloning a vmware VM that has a basic sudo user, and configuring it's networking/dns/firewall. Once all that was set up, I tried running my playbook. Ended up with this:
/path/to/ansible/stuff/$ ansible-playbook --check --ask-sudo-pass --ask-pass --sudo -i prod firstrun.yml
SSH password:
sudo password [defaults to SSH password]:
PLAY [hostname.edu] *****************************************
GATHERING FACTS ***************************************************************
fatal: [hostname.edu] => Authentication or permission failure. In some cases, you may have been able to authenticate and did not have permissions on the remote directory. Consider changing the remote temp path in ansible.cfg to a path rooted in "/tmp". Failed command was: mkdir -p $HOME/.ansible/tmp/ansible-1382136077.67-208472098868660 && chmod a+rx $HOME/.ansible/tmp/ansible-1382136077.67-208472098868660 && echo $HOME/.ansible/tmp/ansible-1382136077.67-208472098868660, exited with result 6
TASK: [update apt cache] ******************************************************
FATAL: no hosts matched or all hosts have already failed -- aborting
PLAY RECAP ********************************************************************
to retry, use: --limit @/home/username/firstrun.retry
hostname.edu : ok=0 changed=0 unreachable=1 failed=0
Yesterday I ran into the same thing with another server, but it randomly started working. I don't remember doing anything different.
My user works fine. I can ssh in and run sudo commands as normal.
Running:
mkdir -p $HOME/.ansible/tmp/ansible-1382136077.67-208472098868660 && chmod a+rx $HOME/.ansible/tmp/ansible-1382136077.67-208472098868660 && echo $HOME/.ansible/tmp/ansible-1382136077.67-208472098868660
Works fine if I do it manually.
I checked the auth.log on the new server and found this appearing when I try to run ansible:
Oct 18 15:41:11 ws-prod-pathways-01 sshd[10314]: Connection closed by mydesktopstaticip [preauth]
I'd think something was bad on my local desktop. But I can run ansible playbooks just find on several other vm's that have ssh key authentication set up. It's just this initial run with the password auth that fails.
I guess I'll try changing the ansible.cfg file like the error message suggests, but it still seems weird that my user can't seem to auth.
Any suggestions?