Skip to content

Instantly share code, notes, and snippets.

View kvegh's full-sized avatar

Karoly "Charlie" VEGH kvegh

View GitHub Profile
@sivel
sivel / inventory2json.py
Last active December 19, 2023 01:54
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
@tuxfight3r
tuxfight3r / ansible_tower_notes.txt
Last active August 8, 2021 06:01
Update Ansible Tower licence via REST api
##GET TOKEN
#Query to retrieve token
curl -X POST -k -v \
-H 'Content-Type: application/json' \
--data @/tmp/cred.json \
https://tower.super.io/api/v1/authtoken/
#cat /tmp/cred.json
{ "username": "admin",
"password": "secretpass" }