mirror of
https://github.com/ZwareBear/awx.git
synced 2026-04-05 07:31:49 -05:00
54 lines
1.4 KiB
YAML
54 lines
1.4 KiB
YAML
---
|
|
- name: Generate names
|
|
set_fact:
|
|
team_name: "AWX-Collection-tests-tower_team-team-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
|
|
|
- name: Attempt to add a Tower team to a non-existant Organization
|
|
tower_team:
|
|
name: Test Team
|
|
organization: Missing Organization
|
|
state: present
|
|
register: result
|
|
ignore_errors: true
|
|
|
|
- name: Assert a meaningful error was provided for the failed Tower team creation
|
|
assert:
|
|
that:
|
|
- result is failed
|
|
- "result.msg =='Failed to update team, organization not found: The requested object could not be found.' or
|
|
result.msg =='The organizations Missing Organization was not found on the Tower server'"
|
|
|
|
- name: Create a Tower team
|
|
tower_team:
|
|
name: "{{ team_name }}"
|
|
organization: Default
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- "result is changed"
|
|
|
|
- name: Delete a Tower team
|
|
tower_team:
|
|
name: "{{ team_name }}"
|
|
organization: Default
|
|
state: absent
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- "result is changed"
|
|
|
|
- name: Check module fails with correct msg
|
|
tower_team:
|
|
name: "{{ team_name }}"
|
|
organization: Non Existing Org
|
|
state: present
|
|
register: result
|
|
ignore_errors: true
|
|
|
|
- assert:
|
|
that:
|
|
- "result.msg =='Failed to update team, organization not found: The requested object could not be found.' or
|
|
result.msg =='The organizations Non Existing Org was not found on the Tower server'"
|