Files
awx/awx_collection/tests/integration/targets/bulk_host_create/main.yml
Elijah DeLee 9e037f1a02 fixup return values for bulk launch and host create in awxkit
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
2023-03-08 12:58:12 -05:00

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