mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
35 lines
658 B
YAML
35 lines
658 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 Group
|
||
|
tower_group:
|
||
|
name: Some Group
|
||
|
inventory: Demo Inventory
|
||
|
state: present
|
||
|
source: ec2
|
||
|
variables: "@{{ tempdir.stdout }}/vars"
|
||
|
register: result
|
||
|
|
||
|
- assert:
|
||
|
that:
|
||
|
- "result is changed"
|
||
|
|
||
|
- name: Delete a Group
|
||
|
tower_group:
|
||
|
name: Some Group
|
||
|
inventory: Demo Inventory
|
||
|
state: absent
|
||
|
register: result
|
||
|
|
||
|
- assert:
|
||
|
that:
|
||
|
- "result is changed"
|