mirror of
https://github.com/ansible/awx.git
synced 2026-05-21 15:57:52 -02:30
Change awx.awx.application to output the OAuth2 client secret
if one was generated.
This commit is contained in:
@@ -147,8 +147,12 @@ def main():
|
|||||||
if redirect_uris is not None:
|
if redirect_uris is not None:
|
||||||
application_fields['redirect_uris'] = ' '.join(redirect_uris)
|
application_fields['redirect_uris'] = ' '.join(redirect_uris)
|
||||||
|
|
||||||
# If the state was present and we can let the module build or update the existing application, this will return on its own
|
response = module.create_or_update_if_needed(application, application_fields, endpoint='applications', item_type='application', auto_exit=False)
|
||||||
module.create_or_update_if_needed(application, application_fields, endpoint='applications', item_type='application')
|
if 'client_id' in response:
|
||||||
|
module.json_output['client_id'] = response['client_id']
|
||||||
|
if 'client_secret' in response:
|
||||||
|
module.json_output['client_secret'] = response['client_secret']
|
||||||
|
module.exit_json(**module.json_output)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|||||||
@@ -103,6 +103,7 @@
|
|||||||
- assert:
|
- assert:
|
||||||
that:
|
that:
|
||||||
- "result is changed"
|
- "result is changed"
|
||||||
|
- "'client_secret' in result"
|
||||||
|
|
||||||
- name: Rename an inventory
|
- name: Rename an inventory
|
||||||
application:
|
application:
|
||||||
|
|||||||
Reference in New Issue
Block a user