From d5dfa5dc8ab6727642224562b4c23c766b8072ae Mon Sep 17 00:00:00 2001 From: Emiliano Vavassori Date: Sun, 6 Sep 2015 22:15:40 +0200 Subject: [PATCH] Updated README with latest changes. Included ansdyninv.py for testing. --- README.md | 2 -- ansdyninv.py | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) create mode 100755 ansdyninv.py diff --git a/README.md b/README.md index 162957f..15bd499 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,6 @@ installation via PXE and using custom kickstart files. ## ToDo List ## -* Fix HTTPS proxy (needs to load a certificate in each client) -* Add and test operators for sudo operations * Implementation of dynamic inventory for `ansible-pull` (should permit to pass further configuration variables with the help of [`doraemon`](https://github.com/bglug-it/doraemon)) diff --git a/ansdyninv.py b/ansdyninv.py new file mode 100755 index 0000000..ced4512 --- /dev/null +++ b/ansdyninv.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python +# vim:sts=2:sw=2 + +from argparse import ArgumentParser +import requests + +parser = ArgumentParser() +parser.add_argument('--list', help="Returns a JSON dictionary of all the groups to be managed.", action="store_true") +parser.add_argument('--host', nargs='?', help="Returns an empty JSON dictionary.") +args = parser.parse_args() + +if args.list: + r = requests.get("http://localhost:3000/ansible_inventory") + if r.status_code != 200: + sys.exit(1) + + print r.text + +if args.host: + print "{}"