-
Notifications
You must be signed in to change notification settings - Fork 24.2k
Description
ISSUE TYPE
- Bug Report
COMPONENT NAME
consul_kv
ANSIBLE VERSION
ansible 2.4.2.0
config file = None
configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/lib/python3.6/site-packages/ansible
executable location = /usr/local/bin/ansible
python version = 3.6.2 (default, Sep 13 2017, 14:26:54) [GCC 4.9.2]
CONFIGURATION
N/A
OS / ENVIRONMENT
N/A
SUMMARY
The python-consul library gives precedence to environment variables over arguments. This can lead to the values binded to the host, port, token, validate_certs and scheme parameters of this module being unexpectedly overriden if CONSUL_HTTP_ADDR, CONSUL_HTTP_TOKEN, CONSUL_HTTP_SSL or CONSUL_HTTP_SSL_VERIFY environment variables are set.
Arguably, the precedence ordering implemented by python-consul is wrong. There is an issue for this (python-consul/python-consul#192) but, given the library does not appear to be actively maintained, it is unlikely to be addressed any time soon.
STEPS TO REPRODUCE
Use consul_kv with any of the distruptive environment variables listed above set.
EXPECTED RESULTS
The module should use the host, port, token, etc. that it was given.
ACTUAL RESULTS
The module uses whatever is set in the environment variables instead.