From 1c504eff689ae64ac17e0f19a6e4e82fc8f81dfc Mon Sep 17 00:00:00 2001 From: Joshua Conner Date: Thu, 20 Mar 2014 15:16:28 -0700 Subject: [PATCH] etcd lookup: use $ANSIBLE_ETCD_URL if it exists in the env --- lib/ansible/runner/lookup_plugins/etcd.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/ansible/runner/lookup_plugins/etcd.py b/lib/ansible/runner/lookup_plugins/etcd.py index 07adec80297..a758a2fb0b5 100644 --- a/lib/ansible/runner/lookup_plugins/etcd.py +++ b/lib/ansible/runner/lookup_plugins/etcd.py @@ -16,6 +16,7 @@ # along with Ansible. If not, see . from ansible import utils +import os import urllib2 try: import json @@ -24,6 +25,8 @@ except ImportError: # this can be made configurable, not should not use ansible.cfg ANSIBLE_ETCD_URL = 'http://127.0.0.1:4001' +if os.getenv('ANSIBLE_ETCD_URL') is not None: + ANSIBLE_ETCD_URL = os.environ['ANSIBLE_ETCD_URL'] class etcd(): def __init__(self, url=ANSIBLE_ETCD_URL): @@ -62,7 +65,7 @@ class LookupModule(object): def run(self, terms, inject=None, **kwargs): - terms = utils.listify_lookup_plugin_terms(terms, self.basedir, inject) + terms = utils.listify_lookup_plugin_terms(terms, self.basedir, inject) if isinstance(terms, basestring): terms = [ terms ]