Initial cut at tower_token module

This commit is contained in:
John Westcott IV
2020-05-21 13:14:10 -04:00
parent e6b1e55274
commit e6416d770b
4 changed files with 220 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
---
- name: Generate names
set_fact:
token_description: "AWX-Collection-tests-tower_token-description-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
- name: Create a Token
tower_token:
description: '{{ token_description }}'
scope: "write"
state: present
register: new_token
- name: Validate our token works by token
tower_job_list:
tower_oauthtoken: "{{ tower_token.token }}"
- name: Validate out token works by object
tower_job_list:
tower_oauthtoken: "{{ tower_token }}"
- name: Delete our Token with our own token
tower_token:
existing_token: "{{ tower_token }}"
tower_oauthtoken: "{{ tower_token }}"
state: absent