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

Inventory Definition Syntax

Jump to solution

--- prod: children: westus: hosts: srv3: srv[1:2]: prefered_python: /usr/bin/python3.6 centralus:hosts: srv4

vs

[prod] [prod:children] westus centralus [westus] srv[1:2] prefered_python=/usr/bin/python3.6 srv3 [centralus] srv4

 

Are the above 2 lines equivalent inventory definitions?  If so, what does the syntax (format) look like
when entered into an actual file?   Also, will they set a variable, just for the srv1 and srv2 host, in the
westus group?

 

Trevor "Red Hat Evangelist" Chandler
Labels (1)
1 Solution

Accepted Solutions
Chetan_Tiwary_
Community Manager
Community Manager
  • 101 Views

@Trevor yes both are valid provided they are formatted correctly as per the intended style ( INI or YAML ). 

---
all:
  children:
    prod:
      children:
        westus:
          hosts:
            srv3:
            srv[1:2]:
          vars:
            prefered_python: /usr/bin/python3.6
        centralus:
          hosts:
            srv4:

 

[prod:children]
westus
centralus

[westus]
srv[1:2] prefered_python=/usr/bin/python3.6
srv3

[centralus]
srv4

 

I think yes only for srv1 & srv2 afaict. 

View solution in original post

1 Reply
Chetan_Tiwary_
Community Manager
Community Manager
  • 102 Views

@Trevor yes both are valid provided they are formatted correctly as per the intended style ( INI or YAML ). 

---
all:
  children:
    prod:
      children:
        westus:
          hosts:
            srv3:
            srv[1:2]:
          vars:
            prefered_python: /usr/bin/python3.6
        centralus:
          hosts:
            srv4:

 

[prod:children]
westus
centralus

[westus]
srv[1:2] prefered_python=/usr/bin/python3.6
srv3

[centralus]
srv4

 

I think yes only for srv1 & srv2 afaict. 

Join the discussion
You must log in to join this conversation.