ansible_user and ansible_port not getting to ssh to vagrant box

37 views
Skip to first unread message

Bala V

unread,
Jun 7, 2016, 2:58:55 PM6/7/16
to Ansible Project
ISSUE TYPE
  • Bug Report
ANSIBLE VERSION

ansible 2.1.0.0

CONFIGURATION

test-mac:ansible$ ansible --version
ansible 2.1.0.0
config file = /Users/balviswa//ansible.cfg
configured module search path = Default w/o overrides

OS / ENVIRONMENT

mac osx

SUMMARY

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
}

STEPS TO REPRODUCE
  1. Install ansible 2.1.0
  2. configure hosts file to use ansible_user= and ansible_port= to corresponding network mapping in virtual box
  3. Test ansible -m ping
  4. SSH failure
EXPECTED RESULTS

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.

Brian Coca

unread,
Jun 7, 2016, 3:01:30 PM6/7/16
to ansible...@googlegroups.com
these are not valid options to the ansible command: -ansible_user=test -ansible_port=3333



----------
Brian Coca
Reply all
Reply to author
Forward
0 new messages