You are on page 1of 2

Troubleshooting

Inventory -

yaml format :-
In yaml indentation matter a lot.
1. Everything starts with all.
2. end with ‘:’
3.
all:
children:
ungrouped:
hosts:
192.168.0.[1:3]:
servera.lab.example.com:

group1:
hosts:
db1.example.com:
db2.example.com:
ny:
hosts:
x.example.com:
y.example.com:

london:
hosts:
c.example.com:
d.example.com:

california:
children:
hosts:
group1:

Error- Keys only vars,children,hosts


[Trinity@localhost project]$ ansible -i ivn --list-hosts all
[WARNING]: Skipping unexpected key (n) in group (all), only "vars", "children" and "hosts" are
valid

[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit
localhost does not match 'all'

hosts (0):
[Trinity@localhost project]$ cat ivn/inventory
all:
n:
hosts:
192.168.0.[1:3]:
servera.lab.example.com:
ERROR- ALL SHOULD HAVE CHILDREN AND UNGROUPED IN IT
[Trinity@localhost project]$ cat ivn/inventory
all:
hosts:
192.168.0.[1:3]:
servera.lab.example.com:

group1:
hosts:
db1.example.com:
db2.example.com:
ny:
hosts:
x.example.com:
y.example.com:

london:
hosts:
c.example.com:
d.example.com:

[Trinity@localhost project]$ ansible -i ivn --list-hosts all


[WARNING]: Skipping unexpected key (group1) in group (all), only "vars", "children" and "hosts"
are valid

[WARNING]: Skipping unexpected key (ny) in group (all), only "vars", "children" and "hosts" are
valid

[WARNING]: Skipping unexpected key (london) in group (all), only "vars", "children" and "hosts"
are valid

hosts (4):
192.168.0.1
192.168.0.2
192.168.0.3
servera.lab.example.com

You might also like