ansible 2.1.0.0
test-mac:ansible$ ansible --version
ansible 2.1.0.0
config file = /Users/balviswa//ansible.cfg
configured module search path = Default w/o overrides
mac osx
ssh to port mapping in virtualbox not connecting to right port or using right user specified in command line or hosts file
test-mac:ansible test$ ansible -vvvv -m ping pdit -ansible_user=test -ansible_port=3333
Using /Users/test/ansible/ansible.cfg as config file
SSH password:
Loaded callback minimal of type stdout, v2.0
<127.0.0.1> ESTABLISH CONNECTION FOR USER: vagrant on PORT 2222 TO 127.0.0.1
127.0.0.1 | UNREACHABLE! => {
"changed": false,
"msg": "[Errno None] Unable to connect to port 2222 on 127.0.0.1",
"unreachable": true
}
I expect ssh to use value provided in ansible_user and ansible_port instead it is using vagrant and port mapping of 2222 from another box.