| 1 |
|
| 2 |
|
| 3 |
--- |
| 4 |
- hosts: localhost |
| 5 |
collections: |
| 6 |
- theforeman.foreman |
| 7 |
gather_facts: false |
| 8 |
vars_files: |
| 9 |
- vars/server.yml |
| 10 |
- vars/hostgroup.yml |
| 11 |
tasks: |
| 12 |
- include_tasks: tasks/location.yml |
| 13 |
vars: |
| 14 |
location_name: "{{ item }}" |
| 15 |
location_state: present |
| 16 |
with_items: "{{ hostgroup.locations }}" |
| 17 |
- include_tasks: tasks/organization.yml |
| 18 |
vars: |
| 19 |
organization_name: "{{ item }}" |
| 20 |
organization_state: present |
| 21 |
with_items: "{{ hostgroup.organizations }}" |
| 22 |
- include_tasks: tasks/hostgroup.yml |
| 23 |
vars: |
| 24 |
hostgroup_name: "New host group" |
| 25 |
hostgroup_state: absent |
| 26 |
- hosts: tests |
| 27 |
collections: |
| 28 |
- theforeman.foreman |
| 29 |
gather_facts: false |
| 30 |
vars_files: |
| 31 |
- vars/server.yml |
| 32 |
- vars/hostgroup.yml |
| 33 |
tasks: |
| 34 |
- include_tasks: tasks/hostgroup.yml |
| 35 |
vars: |
| 36 |
hostgroup_name: "New host group" |
| 37 |
hostgroup_locations: "{{ hostgroup.locations }}" |
| 38 |
hostgroup_organizations: "{{ hostgroup.organizations }}" |
| 39 |
hostgroup_openscap_proxy: "{{ hostgroup.openscap_proxy }}" |
| 40 |
hostgroup_ansible_roles: |
| 41 |
- thulium_drake.motd |
| 42 |
hostgroup_state: present |
| 43 |
expected_change: true |
| 44 |
|
| 45 |
- include_tasks: tasks/hostgroup.yml |
| 46 |
vars: |
| 47 |
hostgroup_name: "New host group" |
| 48 |
hostgroup_locations: "{{ hostgroup.locations }}" |
| 49 |
hostgroup_organizations: "{{ hostgroup.organizations }}" |
| 50 |
hostgroup_openscap_proxy: "{{ hostgroup.openscap_proxy }}" |
| 51 |
hostgroup_ansible_roles: |
| 52 |
- thulium_drake.motd |
| 53 |
hostgroup_state: present |
| 54 |
expected_change: false |
| 55 |
|
| 56 |
- include_tasks: tasks/hostgroup.yml |
| 57 |
vars: |
| 58 |
hostgroup_name: "New host group" |
| 59 |
hostgroup_locations: "{{ hostgroup.locations }}" |
| 60 |
hostgroup_organizations: "{{ hostgroup.organizations }}" |
| 61 |
hostgroup_openscap_proxy: "{{ hostgroup.openscap_proxy }}" |
| 62 |
hostgroup_ansible_roles: [] |
| 63 |
hostgroup_state: present |
| 64 |
expected_change: true |
| 65 |
|
| 66 |
- include_tasks: tasks/hostgroup.yml |
| 67 |
vars: |
| 68 |
hostgroup_name: "New host group" |
| 69 |
hostgroup_locations: "{{ hostgroup.locations }}" |
| 70 |
hostgroup_organizations: "{{ hostgroup.organizations }}" |
| 71 |
hostgroup_openscap_proxy: "{{ hostgroup.openscap_proxy }}" |
| 72 |
hostgroup_ansible_roles: [] |
| 73 |
hostgroup_state: present |
| 74 |
expected_change: false |
| 75 |
|
| 76 |
- include_tasks: tasks/hostgroup.yml |
| 77 |
vars: |
| 78 |
hostgroup_name: "New host group" |
| 79 |
hostgroup_state: absent |
| 80 |
expected_change: true |
| 81 |
|
| 82 |
- include_tasks: tasks/hostgroup.yml |
| 83 |
vars: |
| 84 |
hostgroup_name: "New host group" |
| 85 |
hostgroup_state: absent |
| 86 |
expected_change: false |
| 87 |
|
| 88 |
- hosts: localhost |
| 89 |
collections: |
| 90 |
- theforeman.foreman |
| 91 |
gather_facts: false |
| 92 |
vars_files: |
| 93 |
- vars/server.yml |
| 94 |
- vars/hostgroup.yml |
| 95 |
tasks: |
| 96 |
- include_tasks: tasks/location.yml |
| 97 |
vars: |
| 98 |
location_name: "{{ item }}" |
| 99 |
location_state: "absent" |
| 100 |
with_items: "{{ hostgroup.locations | reverse | list }}" |
| 101 |
- include_tasks: tasks/organization.yml |
| 102 |
vars: |
| 103 |
organization_name: "{{ item }}" |
| 104 |
organization_state: "absent" |
| 105 |
with_items: "{{ hostgroup.organizations }}" |
| 106 |
... |