0
votes

Ansible was happily doing its thing on with three hosts and then one of the hosts stopped playing nice. Now just issuing

ansible all -m ping I get:

[WARNING]: sftp transfer mechanism failed on [10.2.28.25]. Use ANSIBLE_DEBUG=1 to see detailed information [WARNING]: scp transfer mechanism failed on [10.2.28.25]. Use ANSIBLE_DEBUG=1 to see detailed information [WARNING]: piped transfer mechanism failed on [10.2.28.25]. Use ANSIBLE_DEBUG=1 to see detailed information 10.2.28.25 | FAILED! => { "msg": "failed to transfer file to /root/.ansible/tmp/ansible-local-12819484n3lgy/tmpcikgtk2l /root/.ansible/tmp/ansible-tmp-1598364743.9851992-133532194838082/AnsiballZ_ping.py:\n\ndd: failed to open ‘/root/.ansible/tmp/ansible-tmp-1598364743.9851992-133532194838082/AnsiballZ_ping.py’: No such file or directory\n" }

This sounds like the temporary directory isn't getting made. Looking at the results of

ANSIBLE_DEBUG=1 ansible all -vvvv -m ping 

I see what looks like the mkdir running

I can manually perform scp file transfers so it seems like ssh is working OK. What else can go wrong with just a simple command?

1
from the last two lines error messages from your post, you are trying to scp into a root level directory that does not exist. when you did, you logged in as a user, so the directory existed at the user level.JBone

1 Answers

0
votes

If you are using old version of ansible then it might be the bug https://github.com/ansible/ansible/issues/21562 You can to try fix it by defining the variable $HOME at startup your playbook

HOME=/root ansible-playbook ...