From 303305a3789d65e026db01f318647a036ddfa5ef Mon Sep 17 00:00:00 2001 From: Kenny Woodson Date: Fri, 29 Jan 2016 15:37:16 -0500 Subject: Adding ip address option --- bin/openshift_ansible/awsutil.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'bin/openshift_ansible') diff --git a/bin/openshift_ansible/awsutil.py b/bin/openshift_ansible/awsutil.py index 3639ef733..945e6a20c 100644 --- a/bin/openshift_ansible/awsutil.py +++ b/bin/openshift_ansible/awsutil.py @@ -232,4 +232,14 @@ class AwsUtil(object): if version != 'all': retval.intersection_update(inv.get(AwsUtil.gen_version_tag(version), [])) - return retval + return list(retval) + + def convert_to_ip(self, hosts, cached=False): + """convert a list of host names to ip addresses""" + + inv = self.get_inventory(cached=cached) + ips = [] + for host in hosts: + ips.append(inv['_meta']['hostvars'][host]['oo_public_ip']) + + return ips -- cgit v1.2.3