mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
cd27982959
* fixing the exception import from tower modules * Adding tests for checking tower modules are failing with correct msg * fixed failing tests * fixed failing test in tower_team
46 lines
991 B
YAML
46 lines
991 B
YAML
- name: create a tempdir for hostvars
|
|
local_action: shell mktemp -d
|
|
register: tempdir
|
|
|
|
- name: write a file w/ hostvars
|
|
local_action:
|
|
module: lineinfile
|
|
dest: "{{ tempdir.stdout }}/vars"
|
|
line: '{"foo": "bar"}'
|
|
create: true
|
|
|
|
- name: Create a Host
|
|
tower_host:
|
|
name: "some-host"
|
|
inventory: "Demo Inventory"
|
|
state: present
|
|
variables: "@{{ tempdir.stdout }}/vars"
|
|
register: result
|
|
|
|
- assert:
|
|
that:
|
|
- "result is changed"
|
|
|
|
- name: Delete a Host
|
|
tower_host:
|
|
name: "some-host"
|
|
inventory: "Demo Inventory"
|
|
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.msg =='Failed to update host, inventory not found: The requested object could not be found.'"
|