No /usr/bin/python on FreeBSD 11.2
ph3x opened this issue · 3 comments
Describe the bug
No /usr/bin/python on FreeBSD 11.2 default installation
To Reproduce
Install FreeBSD 11.2 with default options. Do a pkg update to install pkg and
a pkg install python. This will install python{2,3} to /usr/local/bin/python
Expected behavior
ansible-relayor working with correct python path
Version information (please include the following information):
- ansible version
me@aries:~/git/ansible$ ansible --version
ansible 2.6.4
config file = /etc/ansible/ansible.cfg
configured module search path =
[u'/home/me/.ansible/plugins/modules',
u'/usr/share/ansible/plugins/modules']
ansible python module location =
/home/me/.local/lib/python2.7/site-packages/ansible
executable location = /usr/local/bin/ansible
python version = 2.7.13 (default, Nov 24 2017, 17:33:09) [GCC 6.3.0
20170516] - ansible-relayor version (please try to reproduce the bug against the git master branch)
latest master
OS information
Control: Debian 9.5
Server: FreeBSD 11.2
Debug information
me@aries:~/git/ansible$ ansible-playbook playbooks/tor.yml
--ask-pass --limit=at-vie01a-tor01.ph3x.at -vvv
ansible-playbook 2.6.4
config file = /etc/ansible/ansible.cfg
configured module search path =
[u'/home/me/.ansible/plugins/modules',
u'/usr/share/ansible/plugins/modules']
ansible python module location =
/home/me/.local/lib/python2.7/site-packages/ansible
executable location = /usr/local/bin/ansible-playbook
python version = 2.7.13 (default, Nov 24 2017, 17:33:09) [GCC 6.3.0
20170516]
Using /etc/ansible/ansible.cfg as config file
SSH password:
SUDO password[defaults to SSH password]:
Parsed /home/me/git/ansible/hosts inventory source with ini plugin
statically imported:
/home/me/git/ansible/roles/ansible-relayor/tasks/ip-list.yml
statically imported:
/home/me/git/ansible/roles/ansible-relayor/tasks/configure.yml
PLAYBOOK: tor.yml
1 plays in playbooks/tor.yml
PLAY [tor]
TASK [Gathering Facts]
task path: /home/me/git/ansible/playbooks/tor.yml:3
<at-vie01a-tor01.ph3x.at> ESTABLISH SSH CONNECTION FOR USER: None
<at-vie01a-tor01.ph3x.at> SSH: EXEC sshpass -d12 ssh -C -o
ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o
ConnectTimeout=10 -o ControlPath=/home/me/.ansible/cp/f57dd57711
at-vie01a-tor01.ph3x.at '/bin/sh -c '"'"'echo ~ && sleep 0'"'"''
<at-vie01a-tor01.ph3x.at> (0, '/home/me\n', '')
<at-vie01a-tor01.ph3x.at> ESTABLISH SSH CONNECTION FOR USER: None
<at-vie01a-tor01.ph3x.at> SSH: EXEC sshpass -d12 ssh -C -o
ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o
ConnectTimeout=10 -o ControlPath=/home/me/.ansible/cp/f57dd57711
at-vie01a-tor01.ph3x.at '/bin/sh -c '"'"'( umask 77 && mkdir -p "echo /home/me/.ansible/tmp/ansible-tmp-1538126570.88-107464600366541
"
&& echo ansible-tmp-1538126570.88-107464600366541="echo /home/me/.ansible/tmp/ansible-tmp-1538126570.88-107464600366541
"
) && sleep 0'"'"''
<at-vie01a-tor01.ph3x.at> (0,
'ansible-tmp-1538126570.88-107464600366541=/home/me/.ansible/tmp/ansible-tmp-1538126570.88-107464600366541\n',
'')
Using module file
/home/me/.local/lib/python2.7/site-packages/ansible/modules/system/setup.py
<at-vie01a-tor01.ph3x.at> PUT
/home/me/.ansible/tmp/ansible-local-1856dAeqxu/tmpKztMOl TO
/home/me/.ansible/tmp/ansible-tmp-1538126570.88-107464600366541/setup.py
<at-vie01a-tor01.ph3x.at> SSH: EXEC sshpass -d12 sftp -o BatchMode=no -b
- -C -o ControlMaster=auto -o ControlPersist=60s -o
StrictHostKeyChecking=no -o ConnectTimeout=10 -o
ControlPath=/home/me/.ansible/cp/f57dd57711
'[at-vie01a-tor01.ph3x.at]'
<at-vie01a-tor01.ph3x.at> (0, 'sftp> put
/home/me/.ansible/tmp/ansible-local-1856dAeqxu/tmpKztMOl
/home/me/.ansible/tmp/ansible-tmp-1538126570.88-107464600366541/setup.py\n',
'')
<at-vie01a-tor01.ph3x.at> ESTABLISH SSH CONNECTION FOR USER: None
<at-vie01a-tor01.ph3x.at> SSH: EXEC sshpass -d12 ssh -C -o
ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o
ConnectTimeout=10 -o ControlPath=/home/me/.ansible/cp/f57dd57711
at-vie01a-tor01.ph3x.at '/bin/sh -c '"'"'chmod u+x
/home/me/.ansible/tmp/ansible-tmp-1538126570.88-107464600366541/
/home/me/.ansible/tmp/ansible-tmp-1538126570.88-107464600366541/setup.py
&& sleep 0'"'"''
<at-vie01a-tor01.ph3x.at> (0, '', '')
<at-vie01a-tor01.ph3x.at> ESTABLISH SSH CONNECTION FOR USER: None
<at-vie01a-tor01.ph3x.at> SSH: EXEC sshpass -d12 ssh -C -o
ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o
ConnectTimeout=10 -o ControlPath=/home/me/.ansible/cp/f57dd57711
-tt at-vie01a-tor01.ph3x.at '/bin/sh -c '"'"'/usr/bin/python
/home/me/.ansible/tmp/ansible-tmp-1538126570.88-107464600366541/setup.py
&& sleep 0'"'"''
<at-vie01a-tor01.ph3x.at> (127, '/bin/sh: /usr/bin/python: not
found\r\n', 'Shared connection to at-vie01a-tor01.ph3x.at closed.\r\n')
<at-vie01a-tor01.ph3x.at> ESTABLISH SSH CONNECTION FOR USER: None
<at-vie01a-tor01.ph3x.at> SSH: EXEC sshpass -d12 ssh -C -o
ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o
ConnectTimeout=10 -o ControlPath=/home/me/.ansible/cp/f57dd57711
at-vie01a-tor01.ph3x.at '/bin/sh -c '"'"'rm -f -r
/home/me/.ansible/tmp/ansible-tmp-1538126570.88-107464600366541/ >
/dev/null 2>&1 && sleep 0'"'"''
<at-vie01a-tor01.ph3x.at> (0, '', '')
fatal: [at-vie01a-tor01.ph3x.at]: FAILED! => {
"changed": false,
"module_stderr": "Shared connection to at-vie01a-tor01.ph3x.at
closed.\r\n",
"module_stdout": "/bin/sh: /usr/bin/python: not found\r\n",
"msg": "MODULE FAILURE",
"rc": 127
}
to retry, use: --limit @/home/me/git/ansible/playbooks/tor.retry
PLAY RECAP
at-vie01a-tor01.ph3x.at : ok=0 changed=0 unreachable=0
failed=1
please see the requirements:
https://github.com/nusenu/ansible-relayor#requirements
python 2 under /usr/bin/python
you can simply create a link for that
alternatively you can tell ansible the path to python (if you don't want to create a link)
Here are official ansible notes for overriding default python path - https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#managed-node-requirements
Missed that point since my relays were running on Debian where python is located under /usr/bin/python-