Addig tests and updating minor module bugs

This commit is contained in:
John Westcott IV
2020-09-22 15:22:35 -04:00
parent 1c729518a5
commit c5df37777b
3 changed files with 124 additions and 15 deletions

View File

@@ -0,0 +1,79 @@
---
- name: Generate a test id
set_fact:
test_id: "{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
- name: Generate names
set_fact:
app1_name: "AWX-Collection-tests-tower_application-app1-{{ test_id }}"
app2_name: "AWX-Collection-tests-tower_application-app2-{{ test_id }}"
app3_name: "AWX-Collection-tests-tower_application-app3-{{ test_id }}"
- block:
- name: Create an application
tower_application:
name: "{{ app1_name }}"
authorization_grant_type: "password"
client_type: "public"
organization: "Default"
state: present
register: result
- assert:
that:
- "result is changed"
- name: Delete our application
tower_application:
name: "{{ app1_name }}"
organization: "Default"
state: absent
register: result
- assert:
that:
- "result is changed"
- name: Create a second application
tower_application:
name: "{{ app2_name }}"
authorization_grant_type: "authorization-code"
client_type: "confidential"
organization: "Default"
description: "Another application"
redirect_uris:
- http://tower.com/api/v2/
- http://tower.com/api/v2/teams
state: present
register: result
- assert:
that:
- "result is changed"
- name: Create an all trusting application
tower_application:
name: "{{ app3_name }}"
organization: "Default"
description: "All Trusting Application"
skip_authorization: True
authorization_grant_type: "password"
client_type: "confidential"
state: present
register: result
- assert:
that:
- "result is changed"
always:
- name: Delete our application
tower_application:
name: "{{ item }}"
organization: "Default"
state: absent
register: result
loop:
- "{{ app1_name }}"
- "{{ app2_name }}"
- "{{ app3_name }}"