mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
etcd lookup: use $ANSIBLE_ETCD_URL if it exists in the env
This commit is contained in:
parent
14499e8bf3
commit
1c504eff68
1 changed files with 4 additions and 1 deletions
|
@ -16,6 +16,7 @@
|
|||
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
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):
|
||||
|
|
Loading…
Reference in a new issue