It doesn’t seem to work, and I couldn’t find much info on ansible docs around yaml inventory file.
Please let me if above yaml works as inventory file in any ansible version ?.. thanks in advance!
Specifically, note from the example Matt provided that all values in the YAML inventory file are map values, never lists. So the - (dash) preceding your “prod” and “stag” groups should be removed. Also note that all hosts listed under a “host:” mapping are also mapping values, so must end with a colon. Finally, groups which are children of other groups should be listed under the “children:” mapping under the parent group. So your example should look like: