--- 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 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.
@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.
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.