mirror of
https://github.com/ansible/awx.git
synced 2026-05-20 07:17:40 -02:30
Collection: Use random names when we create objects in our tests
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user