bastion host type connection to ansible

44 views
Skip to first unread message

Oğuz Yarımtepe

unread,
Dec 16, 2016, 3:02:05 AM12/16/16
to Ansible Project
How can use ansible with the below ssh.cfg

Host test
    Hostname 10.35.74.241
    User oyarimtepe@syslnx#host.f...@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?

Greg Langford

unread,
Dec 21, 2016, 11:32:36 AM12/21/16
to Ansible Project
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/

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.


On Friday, 16 December 2016 08:02:05 UTC, Oğuz Yarımtepe wrote:
How can use ansible with the below ssh.cfg

Host test
    Hostname 10.35.74.241
    User oyarimtepe@syslnx#host.foo.c...@machine1.host.foo.com
Reply all
Reply to author
Forward
0 new messages