Wrong ssh_args
After following the quick start guide I tried to do a ansible all -m ping
to see if ansible was configured right but I got this:
ansible -vvv all -m ping
ansible 2.6.5
config file = /home/varac/projects/cad/infrastructure/float-config/config/ansible.cfg
configured module search path = [u'/home/varac/projects/cad/infrastructure/float-config/float/library']
ansible python module location = /usr/lib/python2.7/dist-packages/ansible
executable location = /usr/bin/ansible
python version = 2.7.15+ (default, Oct 2 2018, 22:12:08) [GCC 8.2.0]
Using /home/varac/projects/cad/infrastructure/float-config/config/ansible.cfg as config file
Parsed /home/varac/projects/cad/infrastructure/float-config/config/hosts.yml inventory source with float plugin
META: ran handlers
Using module file /usr/lib/python2.7/dist-packages/ansible/modules/system/ping.py
<94.130.249.53> ESTABLISH SSH CONNECTION FOR USER: doer
<94.130.249.53> SSH: EXEC ssh - C -o ControlMaster=auto -o ControlPersist=120s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=doer -o ConnectTimeout=10 -o ControlPath=/home/varac/.ansible/cp/%h-%r 94.130.249.53 '/bin/sh -c '"'"'/usr/bin/python && sleep 0'"'"''
host1 | UNREACHABLE! => {
"changed": false,
"msg": "SSH Error: data could not be sent to remote host \"94.130.249.53\". Make sure this host can be reached over ssh",
"unreachable": true
}
See the space between -
and -C
in the beginning of the ssh command.
It's coming from ansible.cfg
which got created by float create-env
:
[ssh_connection]
ssh_args =- C -o ControlMaster=auto -o ControlPersist=120s