mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 01:57:35 -03:30
Modifying credential for new get_one
This commit is contained in:
parent
5042ad3a2b
commit
24ec129235
@ -365,13 +365,14 @@ def main():
|
||||
|
||||
# Attempt to look up the object based on the provided name, credential type and optional organization
|
||||
lookup_data = {
|
||||
'name': name,
|
||||
'credential_type': cred_type_id,
|
||||
}
|
||||
if organization:
|
||||
lookup_data['organization'] = org_id
|
||||
|
||||
credential = module.get_one('credentials', **{'data': lookup_data})
|
||||
credential = module.get_one('credentials', name_or_id=name, **{'data': lookup_data})
|
||||
# If we got an item back make sure the name field reflects the actual name (incase we were passed an ID)
|
||||
name = credential['name'] if (credential) else name
|
||||
|
||||
if state == 'absent':
|
||||
# If the state was absent we can let the module delete it if needed, the module will handle exiting from this
|
||||
|
||||
@ -82,9 +82,9 @@
|
||||
that:
|
||||
- "result is changed"
|
||||
|
||||
- name: Re-create the Org-specific credential (new school)
|
||||
- name: Re-create the Org-specific credential (new school) with an ID
|
||||
tower_credential:
|
||||
name: "{{ ssh_cred_name1 }}"
|
||||
name: "{{ result.id }}"
|
||||
organization: Default
|
||||
credential_type: 'Machine'
|
||||
state: present
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user