| 1 | --- |
| 2 | - hosts: localhost |
| 3 | collections: |
| 4 | - theforeman.foreman |
| 5 | gather_facts: false |
| 6 | vars_files: |
| 7 | - vars/server.yml |
| 8 | - vars/compute_profile.yml |
| 9 | |
| 10 | tasks: |
| 11 | - include_tasks: tasks/organization.yml |
| 12 | vars: |
| 13 | organization_state: present |
| 14 | - include_tasks: tasks/location.yml |
| 15 | vars: |
| 16 | location_state: present |
| 17 | - include_tasks: tasks/compute_resource.yml |
| 18 | vars: |
| 19 | compute_resource_name: "MYCR" |
| 20 | compute_resource_state: present |
| 21 | compute_resource_provider: libvirt |
| 22 | compute_resource_provider_params: "{{ libvirt.compute_resource.params }}" |
| 23 | - include_tasks: tasks/operatingsystem.yml |
| 24 | vars: |
| 25 | operatingsystem_description: "MYOS SP1" |
| 26 | operatingsystem_name: "MYOS" |
| 27 | operatingsystem_minor: 1 |
| 28 | operatingsystem_state: present |
| 29 | - include_tasks: tasks/operatingsystem.yml |
| 30 | vars: |
| 31 | operatingsystem_description: "MY2NDOS" |
| 32 | operatingsystem_name: "MY2NDOS" |
| 33 | operatingsystem_minor: 1 |
| 34 | operatingsystem_state: present |
| 35 | - include_tasks: tasks/architecture.yml |
| 36 | vars: |
| 37 | operatingsystems: |
| 38 | - "MYOS SP1" |
| 39 | - "MY2NDOS" |
| 40 | architecture_name: "MY1024" |
| 41 | architecture_state: present |
| 42 | - include_tasks: tasks/image.yml |
| 43 | vars: |
| 44 | image_name: "MYOS 1" |
| 45 | image_uuid: "{{ libvirt.compute_resource.image_uuid }}" |
| 46 | image_username: "myosadmin" |
| 47 | image_operatingsystem: "MYOS SP1" |
| 48 | image_compute_resource: "MYCR" |
| 49 | image_architecture: "MY1024" |
| 50 | image_state: absent |
| 51 | - include_tasks: tasks/image.yml |
| 52 | vars: |
| 53 | image_name: "MYOS 1" |
| 54 | image_uuid: "{{ libvirt.compute_resource.image_uuid_2 }}" |
| 55 | image_username: "myosadmin" |
| 56 | image_operatingsystem: "MY2NDOS" |
| 57 | image_compute_resource: "MYCR" |
| 58 | image_architecture: "MY1024" |
| 59 | image_state: absent |
| 60 | |
| 61 | |
| 62 | - hosts: tests |
| 63 | collections: |
| 64 | - theforeman.foreman |
| 65 | gather_facts: false |
| 66 | vars_files: |
| 67 | - vars/server.yml |
| 68 | - vars/compute_profile.yml |
| 69 | tasks: |
| 70 | - name: 'MYIMAGE' |
| 71 | block: |
| 72 | - name: Create MYIMAGE |
| 73 | include_tasks: tasks/image.yml |
| 74 | vars: |
| 75 | image_name: "MYOS 1" |
| 76 | image_uuid: "{{ libvirt.compute_resource.image_uuid }}" |
| 77 | image_username: "myosadmin" |
| 78 | image_operatingsystem: "MYOS SP1" |
| 79 | image_compute_resource: "MYCR" |
| 80 | image_architecture: "MY1024" |
| 81 | image_state: present |
| 82 | expected_change: true |
| 83 | - name: Do not change MYIMAGE |
| 84 | include_tasks: tasks/image.yml |
| 85 | vars: |
| 86 | image_name: "MYOS 1" |
| 87 | image_uuid: "{{ libvirt.compute_resource.image_uuid }}" |
| 88 | image_username: "myosadmin" |
| 89 | image_operatingsystem: "MYOS SP1" |
| 90 | image_compute_resource: "MYCR" |
| 91 | image_architecture: "MY1024" |
| 92 | image_state: present |
| 93 | expected_change: false |
| 94 | - name: Modify MYIMAGE |
| 95 | include_tasks: tasks/image.yml |
| 96 | vars: |
| 97 | image_name: "MYOS 1" |
| 98 | image_uuid: "{{ libvirt.compute_resource.image_uuid }}" |
| 99 | image_username: "myosadmin" |
| 100 | image_operatingsystem: "MYOS SP1" |
| 101 | image_compute_resource: "MYCR" |
| 102 | image_architecture: "MY1024" |
| 103 | image_user_data: true |
| 104 | image_state: present |
| 105 | expected_change: true |
| 106 | - name: Create MY2NDIMAGE with same name |
| 107 | include_tasks: tasks/image.yml |
| 108 | vars: |
| 109 | image_name: "MYOS 1" |
| 110 | image_uuid: "{{ libvirt.compute_resource.image_uuid_2 }}" |
| 111 | image_username: "myosadmin" |
| 112 | image_operatingsystem: "MY2NDOS" |
| 113 | image_compute_resource: "MYCR" |
| 114 | image_architecture: "MY1024" |
| 115 | image_state: present |
| 116 | expected_change: true |
| 117 | - name: Do not change MY2NDIMAGE |
| 118 | include_tasks: tasks/image.yml |
| 119 | vars: |
| 120 | image_name: "MYOS 1" |
| 121 | image_uuid: "{{ libvirt.compute_resource.image_uuid_2 }}" |
| 122 | image_username: "myosadmin" |
| 123 | image_operatingsystem: "MY2NDOS" |
| 124 | image_compute_resource: "MYCR" |
| 125 | image_architecture: "MY1024" |
| 126 | image_state: present |
| 127 | expected_change: false |
| 128 | - name: Do not change MYIMAGE |
| 129 | include_tasks: tasks/image.yml |
| 130 | vars: |
| 131 | image_name: "MYOS 1" |
| 132 | image_uuid: "{{ libvirt.compute_resource.image_uuid }}" |
| 133 | image_username: "myosadmin" |
| 134 | image_operatingsystem: "MYOS SP1" |
| 135 | image_compute_resource: "MYCR" |
| 136 | image_architecture: "MY1024" |
| 137 | image_state: present |
| 138 | expected_change: false |
| 139 | - name: Delete MYIMAGE |
| 140 | include_tasks: tasks/image.yml |
| 141 | vars: |
| 142 | image_name: "MYOS 1" |
| 143 | image_uuid: "{{ libvirt.compute_resource.image_uuid }}" |
| 144 | image_username: "myosadmin" |
| 145 | image_operatingsystem: "MYOS SP1" |
| 146 | image_compute_resource: "MYCR" |
| 147 | image_architecture: "MY1024" |
| 148 | image_user_data: false |
| 149 | image_state: absent |
| 150 | expected_change: true |
| 151 | - name: Delete MY2NDIMAGE |
| 152 | include_tasks: tasks/image.yml |
| 153 | vars: |
| 154 | image_name: "MYOS 1" |
| 155 | image_uuid: "{{ libvirt.compute_resource.image_uuid_2 }}" |
| 156 | image_username: "myosadmin" |
| 157 | image_operatingsystem: "MY2NDOS" |
| 158 | image_compute_resource: "MYCR" |
| 159 | image_architecture: "MY1024" |
| 160 | image_state: absent |
| 161 | expected_change: true |
| 162 | |
| 163 | - hosts: localhost |
| 164 | collections: |
| 165 | - theforeman.foreman |
| 166 | gather_facts: false |
| 167 | vars_files: |
| 168 | - vars/server.yml |
| 169 | tasks: |
| 170 | - include_tasks: tasks/architecture.yml |
| 171 | vars: |
| 172 | operatingsystems: |
| 173 | - "MYOS SP1" |
| 174 | - "MY2NDOS" |
| 175 | architecture_name: "MY1024" |
| 176 | architecture_state: absent |
| 177 | - include_tasks: tasks/operatingsystem.yml |
| 178 | vars: |
| 179 | operatingsystem_description: "MYOS SP1" |
| 180 | operatingsystem_minor: 1 |
| 181 | operatingsystem_state: absent |
| 182 | - include_tasks: tasks/operatingsystem.yml |
| 183 | vars: |
| 184 | operatingsystem_description: "MY2NDOS" |
| 185 | operatingsystem_minor: 1 |
| 186 | operatingsystem_state: absent |
| 187 | - include_tasks: tasks/compute_resource.yml |
| 188 | vars: |
| 189 | compute_resource_name: "MYCR" |
| 190 | compute_resource_state: absent |
| 191 | - include_tasks: tasks/location.yml |
| 192 | vars: |
| 193 | location_state: absent |
| 194 | - include_tasks: tasks/organization.yml |
| 195 | vars: |
| 196 | organization_state: absent |
| 197 | ... |