cancel
Showing results for 
Search instead for 
Did you mean: 
Trevor
Commander Commander
Commander
  • 272 Views

Ansible Inventory File Format

What does the YAML format look like for this inventory definition:

us: children: prod: hosts: srv[1:3]: validation: hosts: srv4: dev: hosts: srv5: ca: hosts: srv[6:7]

 

I'm still developing muscle with this!!!

Trevor "Red Hat Evangelist" Chandler
Labels (3)
6 Replies
Wasim_Raja
Moderator
Moderator
  • 241 Views

@Trevor That's some tree

I hope I did correct here

Something like this:

Wasim_Raja_0-1757926407674.png

 

 

Trevor
Commander Commander
Commander
  • 222 Views

Wasim_Raja, thanks for your response!  The format looks promising!

Let's see if there might be others who will concur, or possibly disagree.

 

Thanks Wasim_Raja!!!

Trevor "Red Hat Evangelist" Chandler
Chetan_Tiwary_
Community Manager
Community Manager
  • 185 Views

@Trevor we will start with all that is the parent / root group and then we have children us and then 4 sub child groups prod, validation , dev, ca :

all:
  children:
    us:
      children:
        prod:
          hosts:
            srv[1:3]:
        validation:
          hosts:
            srv4:
        dev:
          hosts:
            srv5:
        ca:
          hosts:
            srv[6:7]:
Trevor
Commander Commander
Commander
  • 179 Views

Chetan,

So glad you provided this YAML format for this inventory file!

I've looked at a few inventory files over the years, but I can't
say that I ever recall seeing one with the keyword "children"
used multiple times.

The more I ask, the more I learn!!!

 

Trevor "Red Hat Evangelist" Chandler
Chetan_Tiwary_
Community Manager
Community Manager
  • 164 Views

Trevor
Commander Commander
Commander
  • 158 Views

Chetan,

Thanks to you, I can check the box, that I've learned at least one something
today!!!!

Trevor "Red Hat Evangelist" Chandler
Join the discussion
You must log in to join this conversation.