summaryrefslogtreecommitdiffstats
path: root/inventory
diff options
context:
space:
mode:
authorChengcheng Mu <chengcheng.mu@amadeus.com>2015-08-18 10:46:23 +0200
committerChengcheng Mu <chengcheng.mu@amadeus.com>2015-10-01 13:49:10 +0200
commita22fbd327ab9decda9543d47c1ba375b9faecffd (patch)
tree8c1c0cb011980a015fd798612777eece523b5753 /inventory
parent6f5fff8a542d544916427ce625fe46ec31fa76d3 (diff)
downloadopenshift-a22fbd327ab9decda9543d47c1ba375b9faecffd.tar.gz
openshift-a22fbd327ab9decda9543d47c1ba375b9faecffd.tar.bz2
openshift-a22fbd327ab9decda9543d47c1ba375b9faecffd.tar.xz
openshift-a22fbd327ab9decda9543d47c1ba375b9faecffd.zip
GCE-support (more information in PR, README_GCE.md)
Diffstat (limited to 'inventory')
-rwxr-xr-xinventory/gce/hosts/gce.py14
-rwxr-xr-xinventory/openstack/hosts/nova.py2
2 files changed, 12 insertions, 4 deletions
diff --git a/inventory/gce/hosts/gce.py b/inventory/gce/hosts/gce.py
index 3403f735e..bf018f1fe 100755
--- a/inventory/gce/hosts/gce.py
+++ b/inventory/gce/hosts/gce.py
@@ -120,6 +120,8 @@ class GceInventory(object):
os.path.dirname(os.path.realpath(__file__)), "gce.ini")
gce_ini_path = os.environ.get('GCE_INI_PATH', gce_ini_default_path)
+ print "GCE INI PATH :: "+gce_ini_path
+
# Create a ConfigParser.
# This provides empty defaults to each key, so that environment
# variable configuration (as opposed to INI configuration) is able
@@ -173,6 +175,10 @@ class GceInventory(object):
args[1] = os.environ.get('GCE_PEM_FILE_PATH', args[1])
kwargs['project'] = os.environ.get('GCE_PROJECT', kwargs['project'])
+ sys.stderr.write("GCE_EMAIL : "+args[0]+"\n")
+ sys.stderr.write("GCE_PEM_FILE_PATH : "+args[1]+"\n")
+ sys.stderr.write("GCE_PROJECT : "+kwargs['project']+"\n")
+
# Retrieve and return the GCE driver.
gce = get_driver(Provider.GCE)(*args, **kwargs)
gce.connection.user_agent_append(
@@ -211,7 +217,8 @@ class GceInventory(object):
'gce_image': inst.image,
'gce_machine_type': inst.size,
'gce_private_ip': inst.private_ips[0],
- 'gce_public_ip': inst.public_ips[0],
+ # Hosts don't always have a public IP name
+ #'gce_public_ip': inst.public_ips[0],
'gce_name': inst.name,
'gce_description': inst.extra['description'],
'gce_status': inst.extra['status'],
@@ -219,8 +226,8 @@ class GceInventory(object):
'gce_tags': inst.extra['tags'],
'gce_metadata': md,
'gce_network': net,
- # Hosts don't have a public name, so we add an IP
- 'ansible_ssh_host': inst.public_ips[0]
+ # Hosts don't always have a public IP name
+ #'ansible_ssh_host': inst.public_ips[0]
}
def get_instance(self, instance_name):
@@ -284,4 +291,5 @@ class GceInventory(object):
# Run the script
+print "Hello world"
GceInventory()
diff --git a/inventory/openstack/hosts/nova.py b/inventory/openstack/hosts/nova.py
index d5bd8d1ee..3197a57bc 100755
--- a/inventory/openstack/hosts/nova.py
+++ b/inventory/openstack/hosts/nova.py
@@ -34,7 +34,7 @@ except ImportError:
# executed with no parameters, return the list of
# all groups and hosts
-NOVA_CONFIG_FILES = [os.getcwd() + "/nova.ini",
+NOVA_CONFIG_FILES = [os.path.join(os.path.dirname(os.path.realpath(__file__)), "nova.ini"),
os.path.expanduser(os.environ.get('ANSIBLE_CONFIG', "~/nova.ini")),
"/etc/ansible/nova.ini"]