# bastion host type connection to ansible

**URL:** <https://forum.ansible.com/t/bastion-host-type-connection-to-ansible/23271>\
**Category:** Ansible Project\
**Created:** [December 16, 2016, 8:02am UTC](https://forum.ansible.com/t/bastion-host-type-connection-to-ansible/23271 "2016-12-16T08:02:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Oguz\_Yarimtepe](https://avatars.discourse-cdn.com/v4/letter/o/d07c76/32.png) [@Oguz\_Yarimtepe](https://forum.ansible.com/u/Oguz_Yarimtepe)\
**Post date:** [December 16, 2016, 8:02am UTC](https://forum.ansible.com/t/bastion-host-type-connection-to-ansible/23271/1 "2016-12-16T08:02:05Z")

</div>

How can use ansible with the below ssh.cfg

Host test  
Hostname 10.35.74.241  
User oyarimtepe@syslnx#[host.foo.com](http://host.foo.com)@machine1.host.foo.com

I am trying to connect machine1. The above settings let me connect with

`ssh test`

10.35.74.241 is working like a jump host.

I created ansible.cfg as

[defaults]  
inventory = hosts  
host\_key\_checking = False  
log\_path = /path/to//ansible-playbooks/test/out.log

[ssh\_connection]  
ssh\_args = -F /path/to//ansible-playbooks/test/ssh.cfg

The below command didn’t worked

ansible-playbook -i hosts test/playbook.yml --limit test

Any idea?

---

<div class="post-metadata">

**Author:** ![Greg\_Langford](https://avatars.discourse-cdn.com/v4/letter/g/f1d935/32.png) [@Greg\_Langford](https://forum.ansible.com/u/Greg_Langford)\
**Post date:** [December 21, 2016, 4:32pm UTC](https://forum.ansible.com/t/bastion-host-type-connection-to-ansible/23271/2 "2016-12-21T16:32:36Z")

</div>

What are you actually wanting to connect to? Are you wanting to run your ansible playbook on the jump host or a host behind it?

Bear in mind Ansible just uses SSH, so you could look into configuring your local SSH config to use SSHProxyCommand [https://www.cyberciti.biz/faq/linux-unix-ssh-proxycommand-passing-through-one-host-gateway-server/](https://www.cyberciti.biz/faq/linux-unix-ssh-proxycommand-passing-through-one-host-gateway-server/)

My advice would also be skip testing this using a playbook, simplify the process

ansible -i hosts test -m ping

See if you get a response.
