Hi all,
Right now the development of dynamic inventory scripts is somehow cumbersome due to the fact that there’s little to no info exposed when parsing the inventory.
In some cases, it just fails with obscure error like: “JSON value cannot be decoded”
This is true especially in a scenario where we use a directory with a mix of dynamic and static inventory sources (with subdirectories).
The idea is to reuse the verbose parameter from the ansible command line (-v…), pass it to the inventory object constructor and, based on that, do the following:
- output the current inventory step - where we are with the logic of inventory parsing
- show the files that where not executed because of missing executable flags
- handler errors like failed json parsing - because the script returns an invalid json for example
Is this something you will find useful?
- Catalin