# Managing multiple clusters using bastions

**URL:** <https://forum.ansible.com/t/managing-multiple-clusters-using-bastions/15317>\
**Category:** Ansible Project\
**Created:** [May 23, 2014, 2:11pm UTC](https://forum.ansible.com/t/managing-multiple-clusters-using-bastions/15317 "2014-05-23T14:11:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jason\_Levitt](https://avatars.discourse-cdn.com/v4/letter/j/779978/32.png) [@Jason\_Levitt](https://forum.ansible.com/u/Jason_Levitt)\
**Post date:** [May 23, 2014, 2:11pm UTC](https://forum.ansible.com/t/managing-multiple-clusters-using-bastions/15317/1 "2014-05-23T14:11:50Z")

</div>

Suppose your inventory file looks like the following.  
You have three clusters of machines (clusterONE, clusterTWO, clusterTHREE). Each cluster has  
a bastion host (bastionONE, bastionTWO, bastionTHREE) that you must SSH into in order to access other machines  
in the cluster.

What are you options as far as configuring Ansible and SSH to manage these three clusters? Is it possible  
to keep all of the SSH configuration in source code control?

Sample inventory file:

[clusterONE]  
bastionONE  
158.235.223.213  
198.107.146.229  
176.13.38.205  
175.254.141.60  
85.59.14.45  
176.20.118.235

[clusterTWO]  
bastionTWO  
c2mach1  
c2mach2  
c2mach3  
187.77.198.80  
4.120.171.38  
186.236.248.11

[clusterTHREE]  
bastionTHREE  
24.2.218.10  
60.167.213.218  
148.182.176.91  
34.67.66.210  
102.47.60.38  
182.26.160.12  
85.174.57.108

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [May 25, 2014, 8:42pm UTC](https://forum.ansible.com/t/managing-multiple-clusters-using-bastions/15317/2 "2014-05-25T20:42:47Z")

</div>

Ansible when using the openssh connection plugin (-c ssh, the default on everything but RHEL/CentOS) will use your ~/.ssh/config automatically, and follow any ProxyCommand directives you have setup therein.

This would be your best option.

To keep everything in source control, consider checking in an ansible.cfg that specifies the SSH config file in the SSH options section, and also check in that SSH config file.
