I'm having a weird issue with Ansible on a (very) clean install of 10.11.6. I've installed brew, zsh, oh-my-zsh, Lil' snitch and 1password (and literally nothing else). I installed ansible with...
brew install ansible
... which was successful. I then went to a preexisting (and crazy simple) Ansible project and did an...
ansible -m ping all
It then asked me to enter my SSH passphrase. I've reinstated the keys from my previous install but I hadn't previously ssh'd into the server. I entered the passphrase and ansible returned...
$ ansible -m ping all
host1 | UNREACHABLE! => {
"changed": false,
"msg": "Failed to connect to the host via ssh.",
"unreachable": true
}
I then ssh'd into the server to check all was well, and it connected without any problems.
I then re-ran...
$ ansible -m ping all
and it returned...
host1 | FAILED! => {
"changed": false,
"failed": true,
"module_stderr": "",
"module_stdout": "/bin/sh: 1: /usr/bin/python: not found\r\n",
"msg": "MODULE FAILURE",
"parsed": false
}
... which is a bit weird? It seems to be saying it can't find python anymore, despite it finding it first time around?
$ which python
returns /usr/bin/python
$ python --version
returns Python 2.7.10
$ which ansible
returns /usr/local/bin/ansible
$ ansible --version
returns
ansible 2.1.1.0
config file = /pathtoproject/ansible.cfg
configured module search path = Default w/o overrides
I've deliberately not installed pyenv, virtualenv etc.
/usr/bin/python
is definitely there, and I can run python without any problems.
Help?! :-) I'm a Ruby dev and I can't help but think I'm missing something obvious, but as I understand it all the versions check out and everything should be working. I tried changing my shell to sh and rerunning ansible -m ping all
but it fails in the same way.
Any ideas?