Skip to content

Instantly share code, notes, and snippets.

@bill538
bill538 / inventory2json.py
Created February 10, 2020 01:36 — forked from sivel/inventory2json.py
Ansible inventory to dynamic inventory JSON output, accepts all inventory input formats
import sys
import json
from ansible.parsing.dataloader import DataLoader
try:
from ansible.inventory.manager import InventoryManager
A24 = True
except ImportError:
from ansible.vars import VariableManager
### Keybase proof
I hereby claim:
* I am bill538 on github.
* I am dogpile1000 (https://keybase.io/dogpile1000) on keybase.
* I have a public key ASAbCZYL7c0mmMEzLO5gv0yo49lc05jMTP0ZiNUzPgGfzAo
To claim this, I am signing this object: