diff --git a/lookup_plugins/re2oapi.py b/lookup_plugins/re2oapi.py index 6dcbe2b9..3e047916 100644 --- a/lookup_plugins/re2oapi.py +++ b/lookup_plugins/re2oapi.py @@ -12,8 +12,6 @@ For now: TODO: Implement a small client for our needs, this will also remove the sys.path extension ... """ - - from ansible.plugins.lookup import LookupBase from ansible.errors import AnsibleError @@ -47,6 +45,10 @@ class LookupModule(LookupBase): if api_hostname is None: raise AnsibleError('You must specify a hostname to contact re2oAPI') + if api_username is None and api_password is None: + api_username = variables.get('vault_re2o_service_user') + api_password = variables.get('vault_re2o_service_password') + if api_username is None: raise AnsibleError('You must specify a valid username to connect to re2oAPI')