Skip to content

Instantly share code, notes, and snippets.

View OddEssay's full-sized avatar

Paul Bennett-Freeman OddEssay

View GitHub Profile
@OddEssay
OddEssay / inventory2json.py
Created January 18, 2018 10:54 — 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