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,7 +1,8 @@
---
- name: Generate an inventory name
- name: Generate names
set_fact:
inv_name: "inv-for-group-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
host_name: "AWX-Collection-tests-tower_host-host-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
inv_name: "AWX-Collection-tests-tower_host-inv-{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
- name: Create an Inventory
tower_inventory:
@@ -11,7 +12,7 @@
- name: Create a Host
tower_host:
name: "some-host"
name: "{{ host_name }}"
inventory: "{{ inv_name }}"
state: present
variables:
@@ -24,7 +25,7 @@
- name: Delete a Host
tower_host:
name: "some-host"
name: "{{ host_name }}"
inventory: "{{ inv_name }}"
state: absent
register: result