mirror of
https://github.com/ansible/awx.git
synced 2026-03-03 09:48:51 -03:30
Fixing issue with lookup plugin not able to load host, user, etc
This commit is contained in:
@@ -131,6 +131,8 @@ class LookupModule(LookupBase):
|
|||||||
if len(terms) != 1:
|
if len(terms) != 1:
|
||||||
raise AnsibleError('You must pass exactly one endpoint to query')
|
raise AnsibleError('You must pass exactly one endpoint to query')
|
||||||
|
|
||||||
|
self.set_options(direct=kwargs)
|
||||||
|
|
||||||
# Defer processing of params to logic shared with the modules
|
# Defer processing of params to logic shared with the modules
|
||||||
module_params = {}
|
module_params = {}
|
||||||
for plugin_param, module_param in TowerAPIModule.short_params.items():
|
for plugin_param, module_param in TowerAPIModule.short_params.items():
|
||||||
@@ -144,8 +146,6 @@ class LookupModule(LookupBase):
|
|||||||
error_callback=self.handle_error, warn_callback=self.warn_callback
|
error_callback=self.handle_error, warn_callback=self.warn_callback
|
||||||
)
|
)
|
||||||
|
|
||||||
self.set_options(direct=kwargs)
|
|
||||||
|
|
||||||
response = module.get_endpoint(terms[0], data=self.get_option('query_params', {}))
|
response = module.get_endpoint(terms[0], data=self.get_option('query_params', {}))
|
||||||
|
|
||||||
if 'status_code' not in response:
|
if 'status_code' not in response:
|
||||||
|
|||||||
@@ -32,6 +32,16 @@
|
|||||||
register: user_creation_results
|
register: user_creation_results
|
||||||
|
|
||||||
- block:
|
- block:
|
||||||
|
- name: Specify the connection params
|
||||||
|
debug:
|
||||||
|
msg: "{{ query(plugin_name, 'ping', host='DNE://junk.com', username='john', password='not_legit', verify_ssl=True) }}"
|
||||||
|
register: results
|
||||||
|
ignore_errors: True
|
||||||
|
|
||||||
|
- assert:
|
||||||
|
that:
|
||||||
|
- "'DNE' in results.msg"
|
||||||
|
|
||||||
- name: Create our hosts
|
- name: Create our hosts
|
||||||
tower_host:
|
tower_host:
|
||||||
name: "{{ item }}"
|
name: "{{ item }}"
|
||||||
|
|||||||
Reference in New Issue
Block a user