# CentOS(Ansible2.5) --\> Jump/Bastion Server--\> Inventory

**URL:** <https://forum.ansible.com/t/centos-ansible2-5-jump-bastion-server-inventory/28649>\
**Category:** Ansible Project\
**Created:** [September 25, 2018, 9:53pm UTC](https://forum.ansible.com/t/centos-ansible2-5-jump-bastion-server-inventory/28649 "2018-09-25T21:53:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Love](https://avatars.discourse-cdn.com/v4/letter/l/dec6dc/32.png) [@Love](https://forum.ansible.com/u/Love)\
**Post date:** [September 25, 2018, 9:53pm UTC](https://forum.ansible.com/t/centos-ansible2-5-jump-bastion-server-inventory/28649/1 "2018-09-25T21:53:14Z")

</div>

Hello Experts,

Could you please help me how to use Ansible through a Jump/Bastion Server? My desktop (CentOS 7.5) is installed with Ansible 2.5 and I cannot install Ansible on Jump/Bastion server, what are the configuration changes required on my desktop to be able to login as my user and switch to root and ssh to clients to execute daily tasks.

CentOS(Ansible 2.5) → Jump/Bastion Server → Destination Servers

SSH keys are deployed for root user from Jump/Bastion server to all destination servers.

All Linux/Unix servers. NO WinGdows, please tell me I’m not the only one who has/had this issue, do let me know if you have any questions.

 ![Ansible_Jump_Bastion_Example.JPG](https://us1.discourse-cdn.com/ansible/original/2X/b/bd6e7b2c73a35586edfa86b2128d800aa277288f.jpeg)

Thanks in advance

---

<div class="post-metadata">

**Author:** ![Karl\_Auer](https://avatars.discourse-cdn.com/v4/letter/k/cc9497/32.png) [@Karl\_Auer](https://forum.ansible.com/u/Karl_Auer)\
**Post date:** [September 25, 2018, 10:09pm UTC](https://forum.ansible.com/t/centos-ansible2-5-jump-bastion-server-inventory/28649/2 "2018-09-25T22:09:04Z")

</div>

We have a build host that we run Ansible on.

I.e., we don’t run ansible _through_ a bastion host, we run it _on_ a bastion host. This host is just for the purpose, and has (in AWS) an instance policy that allows it to build stuff.

Regards, K.

> **(attachments)**
>
> ![Ansible_Jump_Bastion_Example.JPG](https://us1.discourse-cdn.com/ansible/original/2X/b/bd6e7b2c73a35586edfa86b2128d800aa277288f.jpeg)

---

<div class="post-metadata">

**Author:** ![Karl\_Auer](https://avatars.discourse-cdn.com/v4/letter/k/cc9497/32.png) [@Karl\_Auer](https://forum.ansible.com/u/Karl_Auer)\
**Post date:** [September 25, 2018, 10:11pm UTC](https://forum.ansible.com/t/centos-ansible2-5-jump-bastion-server-inventory/28649/3 "2018-09-25T22:11:33Z")

</div>

Sorry, I suppose I was asking whether you could ADD a new bastion server for Ansible.

Regards, K.

> **(attachments)**
>
> ![Ansible_Jump_Bastion_Example.JPG](https://us1.discourse-cdn.com/ansible/original/2X/b/bd6e7b2c73a35586edfa86b2128d800aa277288f.jpeg)

---

<div class="post-metadata">

**Author:** ![Love](https://avatars.discourse-cdn.com/v4/letter/l/dec6dc/32.png) [@Love](https://forum.ansible.com/u/Love)\
**Post date:** [September 25, 2018, 11:20pm UTC](https://forum.ansible.com/t/centos-ansible2-5-jump-bastion-server-inventory/28649/4 "2018-09-25T23:20:38Z")

</div>

No, I do not have the option to use another Jump/Bastion server, we already have 6 Jump/Bastion servers for different data centers & environments, ansible is not installed on any of them.

---

<div class="post-metadata">

**Author:** ![felixfontein](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/felixfontein/32/7530_2.png) [@felixfontein](https://forum.ansible.com/u/felixfontein)\
**Post date:** [September 26, 2018, 4:02am UTC](https://forum.ansible.com/t/centos-ansible2-5-jump-bastion-server-inventory/28649/5 "2018-09-26T04:02:40Z")

</div>

Hi,

> Could you please help me how to use Ansible through a Jump/Bastion  
> Server? My desktop (CentOS 7.5) is installed with Ansible 2.5 and I  
> cannot install Ansible on Jump/Bastion server, what are the  
> configuration changes required on my desktop to be able to login as  
> my user and switch to root and ssh to clients to execute daily tasks.
> 
> CentOS(Ansible 2.5) --\> Jump/Bastion Server --\> Destination Servers
> 
> SSH keys are deployed for root user from Jump/Bastion server to all  
> destination servers.

in case you have the SSH keys for the destination users also on your  
local machine, you can do that by adding the following to your  
~/.ssh/config file:

Host jump-host.example.com  
User user\_for\_jump\_host  
IdentityFile ~/.ssh/id\_private\_key\_for\_jump\_host

Host destination-1.example.com destination-2.example.com  
User admin\_user\_for\_destinations  
IdentityFile ~/.ssh/id\_private\_key\_for\_destinations  
ProxyCommand ssh -q jump-host.example.com nc -q0 %h 22

If you have newer OpenSSH clients, there are also some simplifications  
for this (see  
[https://superuser.com/questions/1253960/replace-proxyjump-in-ssh-config](https://superuser.com/questions/1253960/replace-proxyjump-in-ssh-config)).

In case you do \*not\* have the keys for the destination machines on your  
local machine, this will not work. Instead, take a look at this one:  
[https://serverfault.com/questions/337274/ssh-from-a-through-b-to-c-using-private-key-on-b/701884#701884](https://serverfault.com/questions/337274/ssh-from-a-through-b-to-c-using-private-key-on-b/701884#701884)  
I've never used that one, so I don't know whether it really works, but  
it looks reasonable.

If the keys on the jump host are not available as the user you logged  
in with, you probably need to include an appropriate 'sudo' into the  
ProxyCommand (probably before ssh-add).

Cheers,  
Felix

---

<div class="post-metadata">

**Author:** ![Love](https://avatars.discourse-cdn.com/v4/letter/l/dec6dc/32.png) [@Love](https://forum.ansible.com/u/Love)\
**Post date:** [October 1, 2018, 5:59pm UTC](https://forum.ansible.com/t/centos-ansible2-5-jump-bastion-server-inventory/28649/6 "2018-10-01T17:59:17Z")

</div>

Thank you, I will try this and post any/all questions based on output.
