I have dynamic inventory working with a hosts file that looks like this:



This is a static group of dynamic groups and is working for me. documentation on working with dynamic inventory doesn't include a YAML example.

I would prefer to use YAML because I find the format neater, but I can't work out from the example in the documentation on inventory how this would look.

Does anybody have any examples?

  • There is no other format for the static inventory file. The dynamic inventory is JSON, not YAML. I'm not really sure where you're going with this? – Michael Hampton May 23 at 14:53

For what it's worth... the equivalent ansible yaml inventory of your current ini is:


I have absolutely no clue if this can be used in your case to create the static group of dynamic groups.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.