mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Remove depedency of lookup plugin on setting in ansible.cfg
This commit is contained in:
parent
5b3c796641
commit
643690ffec
1 changed files with 5 additions and 2 deletions
|
@ -23,8 +23,11 @@ try:
|
||||||
except ImportError:
|
except ImportError:
|
||||||
import simplejson as json
|
import simplejson as json
|
||||||
|
|
||||||
|
# this can be made configurable, not should not use ansible.cfg
|
||||||
|
ANSIBLE_ETCD_URL = 'http://127.0.0.1:4001'
|
||||||
|
|
||||||
class etcd():
|
class etcd():
|
||||||
def __init__(self, url='http://127.0.0.1:4001'):
|
def __init__(self, url=ANSIBLE_ETCD_URL)
|
||||||
self.url = url
|
self.url = url
|
||||||
self.baseurl = '%s/v1/keys' % (self.url)
|
self.baseurl = '%s/v1/keys' % (self.url)
|
||||||
|
|
||||||
|
@ -56,7 +59,7 @@ class LookupModule(object):
|
||||||
|
|
||||||
def __init__(self, basedir=None, **kwargs):
|
def __init__(self, basedir=None, **kwargs):
|
||||||
self.basedir = basedir
|
self.basedir = basedir
|
||||||
self.etcd = etcd(constants.ANSIBLE_ETCD_URL)
|
self.etcd = etcd()
|
||||||
|
|
||||||
def run(self, terms, inject=None, **kwargs):
|
def run(self, terms, inject=None, **kwargs):
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue