support url scheme (#39683)

This commit is contained in:
provonet 2018-05-25 16:13:48 +02:00 committed by ansibot
parent f65df5f62a
commit 33e1453d5a

View file

@ -93,7 +93,7 @@ class LookupModule(LookupBase):
try:
url = os.environ['ANSIBLE_CONSUL_URL']
u = urlparse(url)
consul_api = consul.Consul(host=u.hostname, port=u.port)
consul_api = consul.Consul(host=u.hostname, port=u.port, scheme=u.scheme)
except KeyError:
port = kwargs.get('port', '8500')
host = kwargs.get('host', 'localhost')