Failure with ansible local -a "whoami" on Raspberry Pi

I have the latest OS on my Raspberry Pi and I installed Ansible today on it.

Some commands work fine and return proper results as in: ansible -c local -m ping all

But this one: ansible local -a “whoami” gives the error:

10.0.1.6 | FAILED => could not create temporary directory, SSH (mkdir -p $HOME/.ansible/tmp/ansible-1374897780.62-234052605869123 && chmod a+rx $HOME/.ansible/tmp/ansible-1374897780.62-234052605869123 && echo $HOME/.ansible/tmp/ansible-1374897780.62-234052605869123) exited with result 255

If I execute the command line:

mkdir -p $HOME/.ansible/tmp/ansible-1374897780.62-234052605869123 && chmod a+rx $HOME/.ansible/tmp/ansible-1374897780.62-234052605869123 && echo $HOME/.ansible/tmp/ansible-1374897780.62-234052605869123

it creates the directories without an error.

Here is my ansible/hacking/env-setup:

source ansible/hacking/env-setup
PATH=/var/ansible/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
PYTHONPATH=/var/ansible/lib:
ANSIBLE_LIBRARY=/var/ansible/library
MANPATH=/var/ansible/docs/man:
Reminder: specify your host file with -i
Done.

Here are my directory and file permissions:

drwxr-xr-x 3 pi pi 4096 Jul 26 19:01 .ansible

pi@raspberrypi ~/.ansible $ ls -la
total 16
drwxr-xr-x 3 pi pi 4096 Jul 26 19:01 .
drwxr-xr-x 23 pi pi 4096 Jul 26 21:11 …
-rw-r–r-- 1 pi pi 205 Jul 26 21:02 hosts
drwxr-xr-x 2 pi pi 4096 Jul 26 20:55 tmp

Some help resolving this would be appreciated. :slight_smile:

Thank you.

Don

Note that ansible is logging in as your current user (as does SSH)

What user are you logged in as when SSHd to local?

(If you want to run locally, of course, I suggest connection: local in the playbook or -c local)

Michael,

Thank you for your response.

It turns out that I didn’t have the software configuration correct. However I since have removed Ansible from the Raspberry Pi and instead, installed it on Ubuntu 13.04. It’s working a bit better now.

I don’t know if what I mention below has already been considered, but I’ll post it here in any case.

Is there a script that can be run that verifies that all the pieces of Ansible have been installed in the correct default locations? Perhaps that script would also verify that the correct versions of the pieces are in place?

Thank you.

Don