mirror of
https://github.com/ansible/awx.git
synced 2026-05-19 23:07:42 -02:30
pycharm refactor rename files and class, linux rename tower_ controller_
This commit is contained in:
51
awx_collection/tests/integration/targets/host/tasks/main.yml
Normal file
51
awx_collection/tests/integration/targets/host/tasks/main.yml
Normal file
@@ -0,0 +1,51 @@
|
||||
---
|
||||
- name: Generate names
|
||||
set_fact:
|
||||
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:
|
||||
name: "{{ inv_name }}"
|
||||
organization: Default
|
||||
state: present
|
||||
register: result
|
||||
|
||||
- name: Create a Host
|
||||
tower_host:
|
||||
name: "{{ host_name }}"
|
||||
inventory: "{{ result.id }}"
|
||||
state: present
|
||||
variables:
|
||||
foo: bar
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result is changed"
|
||||
|
||||
- name: Delete a Host
|
||||
tower_host:
|
||||
name: "{{ result.id }}"
|
||||
inventory: "{{ inv_name }}"
|
||||
state: absent
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result is changed"
|
||||
|
||||
- name: Check module fails with correct msg
|
||||
tower_host:
|
||||
name: test-host
|
||||
description: Host Description
|
||||
inventory: test-non-existing-inventory
|
||||
state: present
|
||||
register: result
|
||||
ignore_errors: true
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result is failed"
|
||||
- "'test-non-existing-inventory' in result.msg"
|
||||
- "result.total_results == 0"
|
||||
Reference in New Issue
Block a user