mirror of
https://github.com/ZwareBear/awx.git
synced 2026-03-19 23:33:37 -05:00
Enabled the params bulk job make black make black again Fixed inventory and organization input params for bulk modules add collection integration tests Fix cli return errors fix test completeness
51 lines
1.1 KiB
YAML
51 lines
1.1 KiB
YAML
---
|
|
- name: Generate a random string for test
|
|
set_fact:
|
|
test_id: "{{ lookup('password', '/dev/null chars=ascii_letters length=16') }}"
|
|
when: test_id is not defined
|
|
|
|
- name: Generate a unique name
|
|
set_fact:
|
|
bulk_host_name: "AWX-Collection-tests-bulk_host_create-{{ test_id }}"
|
|
|
|
- name: Get our collection package
|
|
controller_meta:
|
|
register: controller_meta
|
|
|
|
- name: Generate the name of our plugin
|
|
set_fact:
|
|
plugin_name: "{{ controller_meta.prefix }}.controller_api"
|
|
|
|
|
|
- name: Create an inventory
|
|
inventory:
|
|
name: "{{ bulk_host_name }}"
|
|
organization: Default
|
|
state: present
|
|
register: inventory_result
|
|
|
|
|
|
- name: Bulk Host Create
|
|
bulk_host_create:
|
|
hosts:
|
|
- name: "123.456.789.123"
|
|
description: "myhost1"
|
|
variables:
|
|
food: carrot
|
|
color: orange
|
|
- name: example.dns.gg
|
|
description: "myhost2"
|
|
enabled: false
|
|
inventory: "{{ inventory_result.id }}"
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- result is not failed
|
|
|
|
# cleanup
|
|
- name: Delete inventory
|
|
inventory:
|
|
name: "{{ bulk_host_name }}"
|
|
organization: Default
|
|
state: absent |