Ensure schedule collection test has enough hosts for slices

This commit is contained in:
Oleksii Baranov
2022-09-22 14:59:01 +02:00
committed by Alan Rominger
parent 1cfbc02d98
commit 4c64fb3323

View File

@@ -18,6 +18,9 @@
label2: "AWX-Collection-tests-schedule-l2-{{ test_id }}" label2: "AWX-Collection-tests-schedule-l2-{{ test_id }}"
ig1: "AWX-Collection-tests-schedule-ig1-{{ test_id }}" ig1: "AWX-Collection-tests-schedule-ig1-{{ test_id }}"
ig2: "AWX-Collection-tests-schedule-ig2-{{ test_id }}" ig2: "AWX-Collection-tests-schedule-ig2-{{ test_id }}"
slice_inventory: "AWX-Collection-tests-schedule-slice-inv-{{ test_id }}"
host_name: "AWX-Collection-tests-schedule-host-{{ test_id }}"
slice_num: 10
- block: - block:
- name: Try to create without an rrule - name: Try to create without an rrule
@@ -164,6 +167,23 @@
- "{{ ig1 }}" - "{{ ig1 }}"
- "{{ ig2 }}" - "{{ ig2 }}"
- name: Create proper inventory for slice count
inventory:
name: "{{ slice_inventory }}"
organization: "{{ org_name }}"
state: present
register: result
- name: Create a Host
host:
name: "{{ host_name }}-{{ item }}"
inventory: "{{ slice_inventory }}"
state: present
variables:
ansible_connection: local
loop: "{{ range(slice_num)|list }}"
register: result
- name: Create with options that the JT does support - name: Create with options that the JT does support
schedule: schedule:
name: "{{ sched2 }}" name: "{{ sched2 }}"
@@ -173,7 +193,7 @@
description: "This hopefully will work" description: "This hopefully will work"
extra_data: extra_data:
some: var some: var
inventory: Demo Inventory inventory: "{{ slice_inventory }}"
scm_branch: asdf1234 scm_branch: asdf1234
credentials: credentials:
- "{{ cred1 }}" - "{{ cred1 }}"
@@ -189,7 +209,7 @@
instance_groups: instance_groups:
- "{{ ig1 }}" - "{{ ig1 }}"
- "{{ ig2 }}" - "{{ ig2 }}"
job_slice_count: 10 job_slice_count: "{{ slice_num }}"
labels: labels:
- "{{ label1 }}" - "{{ label1 }}"
- "{{ label2 }}" - "{{ label2 }}"
@@ -345,3 +365,18 @@
name: "{{ org_name }}" name: "{{ org_name }}"
state: absent state: absent
ignore_errors: True ignore_errors: True
- name: "Delete slice inventory"
inventory:
name: "{{ slice_inventory }}"
organization: "{{ org_name }}"
state: absent
ignore_errors: True
- name: Delete slice hosts
host:
name: "{{ host_name }}-{{ item }}"
inventory: "{{ slice_inventory }}"
state: absent
loop: "{{ range(slice_num)|list }}"
ignore_errors: True