On 06.08.2018 15:44, eric.b.hymow...@nasa.gov wrote:
I have two ansible servers, call them ansible-a and ansible-b .
ansible-a is my "primary" most-often-used ansible server for most of my
hosts including ansible-b.  However, there is a segregated network that
ansible-a cannot get to, so ansible-b is the ansible server for those hosts
on that network.

I would like to set up a dynamic inventory script so that ansible-a can
refer to hosts managed by the ansible-b server, without manually
duplicating the ansible-b inventory on ansible-a .

I'm hoping somebody has done this already, and has a dynamic inventory
script that will properly

   - query another ansible server
   - specify a group that the remote ansible server knows about
   - return the appropriate hosts in the appropriate format

I tried searching ansible-galaxy, but all I can find are roles. Maybe I'm
not searching correctly.  I have poor google-fu.

Can somebody point me the way?

You could use ansible-b as a ssh proxy/bastion and have all the ansible configuration on ansible-a. Then when ansible-a need to contact host on the segregated network the connection would be proxy-ed through a ansible-b.


To make the dynamic inventory you could do this

#!/bin/bash

ssh <user>@ansible-a "cd /path/to/the/ansible/configuration; ansible-inventory all --list


Make it executable and put it in you inventory on ansible-b.


--
Kai Stian Olstad

--
You received this message because you are subscribed to the Google Groups "Ansible 
Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/f66478c4b796489b98bebf1344dbf04a%40olstad.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to