Hi all, sorry for jumping in, but I’m observing the same behavior.
Here is my playbook:
- hosts: all
gather_facts: no
tasks:
- name: stop vm
raw: poweroff
- name: pause for 5 seconds
local_action: pause seconds=5
Here’s the error with 1.3.0:
PLAY [all] ********************************************************************
TASK: [stop vm] ***************************************************************
ESTABLISH CONNECTION FOR USER: ste
EXEC [‘ssh’, ‘-tt’, ‘-q’, ‘-o’, ‘ControlMaster=auto’, ‘-o’, ‘ControlPersist=60s’, ‘-o’, ‘ControlPath=/home/ste/.ansible/cp/ansible-ssh-%h-%p-%r’, ‘-o’, ‘Port=40067’, ‘-o’, ‘KbdInteractiveAuthentication=no’, ‘-o’, ‘PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey’, ‘-o’, ‘PasswordAuthentication=no’, ‘-o’, ‘ConnectTimeout=10’, ‘wheezy’, ‘poweroff’]
ok: [wheezy] => {“rc”: 0, “stderr”: “”, “stdout”: “”}
TASK: [pause for 5 seconds] ***************************************************
<127.0.0.1> ESTABLISH CONNECTION FOR USER: ste
<127.0.0.1> EXEC [‘ssh’, ‘-tt’, ‘-q’, ‘-o’, ‘ControlMaster=auto’, ‘-o’, ‘ControlPersist=60s’, ‘-o’, ‘ControlPath=/home/ste/.ansible/cp/ansible-ssh-%h-%p-%r’, ‘-o’, ‘Port=22’, ‘-o’, ‘KbdInteractiveAuthentication=no’, ‘-o’, ‘PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey’, ‘-o’, ‘PasswordAuthentication=no’, ‘-o’, ‘ConnectTimeout=10’, ‘127.0.0.1’, “/bin/sh -c ‘mkdir -p $HOME/.ansible/tmp/ansible-1379327501.49-139269735518415 && chmod a+rx $HOME/.ansible/tmp/ansible-1379327501.49-139269735518415 && echo $HOME/.ansible/tmp/ansible-1379327501.49-139269735518415’”]
fatal: [wheezy] => 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-1379327501.49-139269735518415 && chmod a+rx $HOME/.ansible/tmp/ansible-1379327501.49-139269735518415 && echo $HOME/.ansible/tmp/ansible-1379327501.49-139269735518415, exited with result 255
FATAL: all hosts have already failed – aborting
PLAY RECAP ********************************************************************
to retry, use: --limit @/home/ste/stop.retry
wheezy : ok=1 changed=0 unreachable=0 failed=1
Here’s the error with 1.2.3:
PLAY [all] ********************************************************************
TASK: [stop vm] ***************************************************************
ESTABLISH CONNECTION FOR USER: ste
EXEC [‘ssh’, ‘-tt’, ‘-q’, ‘-o’, ‘ControlMaster=auto’, ‘-o’, ‘ControlPersist=60s’, ‘-o’, ‘ControlPath=/home/ste/.ansible/cp/ansible-ssh-%h-%p-%r’, ‘-o’, ‘Port=40067’, ‘-o’, ‘KbdInteractiveAuthentication=no’, ‘-o’, ‘PasswordAuthentication=no’, ‘-o’, ‘ConnectTimeout=10’, ‘wheezy’, ‘poweroff’]
ok: [wheezy] => {“rc”: 0, “stderr”: “”, “stdout”: “\u0007\r\r\nBroadcast message from root@wheezy (pts/1) (Mon Sep 16 07:51:04 2013):\r\r\n\r\r\n\rThe system is going down for system halt NOW!\r\r\n”}
TASK: [pause for 5 seconds] ***************************************************
<127.0.0.1> ESTABLISH CONNECTION FOR USER: ste
<127.0.0.1> EXEC [‘ssh’, ‘-tt’, ‘-q’, ‘-o’, ‘ControlMaster=auto’, ‘-o’, ‘ControlPersist=60s’, ‘-o’, ‘ControlPath=/home/ste/.ansible/cp/ansible-ssh-%h-%p-%r’, ‘-o’, ‘Port=22’, ‘-o’, ‘KbdInteractiveAuthentication=no’, ‘-o’, ‘PasswordAuthentication=no’, ‘-o’, ‘ConnectTimeout=10’, ‘127.0.0.1’, “/bin/sh -c ‘mkdir -p $HOME/.ansible/tmp/ansible-1379328665.95-125157496377766 && chmod a+rx $HOME/.ansible/tmp/ansible-1379328665.95-125157496377766 && echo $HOME/.ansible/tmp/ansible-1379328665.95-125157496377766’”]
fatal: [wheezy] => could not create temporary directory: SSH exited with return code 255
FATAL: all hosts have already failed – aborting
PLAY RECAP ********************************************************************
to retry, use: --limit @/home/ste/stop.retry
wheezy : ok=1 changed=0 unreachable=0 failed=1
It would be great if local_action would not be SSH’ing into localhost, but rather forcing the local connection type, but it doesn’t seem to be the case.
Furthermore, this is especially true for the pause command, does it ever make sense for it to not be executed on the local machine?
Finally, the fatal error message (i.e. what you see without -vvv) seems better in 1.2.3 than in 1.3.0, at least I could more clearly understand there was a problem with SSH and not with file permissions. I understand that the new error message covers both cases (“Authentication or permission failure”) but I wonder if it isn’t worth it to split it into two different messages, according to what the failure really was, as SSH authentication and filesystem permissions seem two very different issues that need to be troubleshooted very differently.
Last but not least, this is my first post to the group so I’d like to take the chance to say thank you for Ansible, I really love it!
ciao
ste