modify ssh config

258 views
Skip to first unread message

mk...@redhat.com

unread,
Dec 15, 2017, 3:12:14 AM12/15/17
to AWX Project
Hi all,
I already searched the web to update ssh configuration, but was unsuccessful. Is there an official way to inject a customized ssh configuration? If not I would raise an issue.

The problem: I have a couple of servers behind a jumphost with a special port, I want to manage with AWX.
As a workaround the following script does the job after installation:

----
#!/bin/bash

docker cp awx_task:/etc/ssh/ssh_config .
cat >> ssh_config << EOT

host jumphost
     Hostname                 jumpjost.someip.com
     User                     jump
     ProxyCommand             none
     Port                     4321
     StrictHostKeyChecking    no
    
host *.hidden.lan
     User            root
     StrictHostKeyChecking    no
     ProxyCommand             ssh root@jumphost -W %h:%p

EOT
docker cp ssh_config awx_task:/etc/ssh/ssh_config
----

Now I can add the hosts server1.hidden.lan, server2.hidden.lan etc. to the inventory and manage them perfectly well.

Thanks for your answer
Cheers
 Markus

ti...@ansible.com

unread,
Dec 19, 2017, 2:40:01 PM12/19/17
to mk...@redhat.com, AWX Project

--
You received this message because you are subscribed to the Google Groups "AWX Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to awx-project+unsubscribe@googlegroups.com.
To post to this group, send email to awx-p...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/awx-project/9c85d190-3dce-43f7-bed2-8e84af9bb881%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Cesar Sanchez

unread,
Jan 4, 2018, 11:08:24 AM1/4/18
to AWX Project
You can leverage that work to your dynamic inventory instead.

You could generate the dynamic inventory that injects that for you and have:

[server1]
server1.hidden.lan ansible_ssh_common_args="-o ProxyCommand=\"ssh -A -W -p 4321 %h:%p -o User=jump jumphost.someip.com\""

-Cesar
Reply all
Reply to author
Forward
0 new messages