Collection: Use random names when we create objects in our tests

This commit is contained in:
Caleb Boylan
2020-03-17 11:49:09 -07:00
parent e210ee4077
commit a03d74d828
16 changed files with 467 additions and 154 deletions

View File

@@ -1,9 +1,13 @@
---
- name: Generate names
set_fact:
username: "AWX-Collection-tests-tower_role-user-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
- name: Create a User
tower_user:
first_name: Joe
last_name: User
username: joe
username: "{{ username }}"
password: "{{ 65535 | random | to_uuid }}"
email: joe@example.org
state: present
@@ -15,7 +19,7 @@
- name: Add Joe to the update role of the default Project
tower_role:
user: joe
user: "{{ username }}"
role: update
project: Demo Project
state: "{{ item }}"
@@ -30,7 +34,7 @@
- name: Delete a User
tower_user:
username: joe
username: "{{ username }}"
email: joe@example.org
state: absent
register: result