Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
"""
Cobbler external inventory script
=================================
Ansible has a feature where instead of reading from /etc/ansible/hosts
as a text file, it can query external programs to obtain the list
of hosts, groups the hosts are in, and even variables to assign to each host.
#!/usr/bin/python
# Author: David McCue
import keystoneclient.v2_0.client as ksclient
import glanceclient.v1.client as glclient
import os, sys
def get_keystone_creds():
d = {}
d['username'] = os.environ['OS_USERNAME']