mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 01:17:37 -02:30
Addig tests and updating minor module bugs
This commit is contained in:
@@ -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 }}"
|
||||
Reference in New Issue
Block a user