--- - hosts: localhost collections: - theforeman.foreman gather_facts: false vars_files: - vars/server.yml - vars/compute_profile.yml tasks: - include_tasks: tasks/organization.yml vars: organization_state: present - include_tasks: tasks/location.yml vars: location_state: present - include_tasks: tasks/compute_resource.yml vars: compute_resource_name: "MYCR" compute_resource_state: present compute_resource_provider: libvirt compute_resource_provider_params: "{{ libvirt.compute_resource.params }}" - include_tasks: tasks/operatingsystem.yml vars: operatingsystem_description: "MYOS SP1" operatingsystem_name: "MYOS" operatingsystem_minor: 1 operatingsystem_state: present - include_tasks: tasks/operatingsystem.yml vars: operatingsystem_description: "MY2NDOS" operatingsystem_name: "MY2NDOS" operatingsystem_minor: 1 operatingsystem_state: present - include_tasks: tasks/architecture.yml vars: operatingsystems: - "MYOS SP1" - "MY2NDOS" architecture_name: "MY1024" architecture_state: present - include_tasks: tasks/image.yml vars: image_name: "MYOS 1" image_uuid: "{{ libvirt.compute_resource.image_uuid }}" image_username: "myosadmin" image_operatingsystem: "MYOS SP1" image_compute_resource: "MYCR" image_architecture: "MY1024" image_state: absent - include_tasks: tasks/image.yml vars: image_name: "MYOS 1" image_uuid: "{{ libvirt.compute_resource.image_uuid_2 }}" image_username: "myosadmin" image_operatingsystem: "MY2NDOS" image_compute_resource: "MYCR" image_architecture: "MY1024" image_state: absent - hosts: tests collections: - theforeman.foreman gather_facts: false vars_files: - vars/server.yml - vars/compute_profile.yml tasks: - name: 'MYIMAGE' block: - name: Create MYIMAGE include_tasks: tasks/image.yml vars: image_name: "MYOS 1" image_uuid: "{{ libvirt.compute_resource.image_uuid }}" image_username: "myosadmin" image_operatingsystem: "MYOS SP1" image_compute_resource: "MYCR" image_architecture: "MY1024" image_state: present expected_change: true - name: Do not change MYIMAGE include_tasks: tasks/image.yml vars: image_name: "MYOS 1" image_uuid: "{{ libvirt.compute_resource.image_uuid }}" image_username: "myosadmin" image_operatingsystem: "MYOS SP1" image_compute_resource: "MYCR" image_architecture: "MY1024" image_state: present expected_change: false - name: Modify MYIMAGE include_tasks: tasks/image.yml vars: image_name: "MYOS 1" image_uuid: "{{ libvirt.compute_resource.image_uuid }}" image_username: "myosadmin" image_operatingsystem: "MYOS SP1" image_compute_resource: "MYCR" image_architecture: "MY1024" image_user_data: true image_state: present expected_change: true - name: Create MY2NDIMAGE with same name include_tasks: tasks/image.yml vars: image_name: "MYOS 1" image_uuid: "{{ libvirt.compute_resource.image_uuid_2 }}" image_username: "myosadmin" image_operatingsystem: "MY2NDOS" image_compute_resource: "MYCR" image_architecture: "MY1024" image_state: present expected_change: true - name: Do not change MY2NDIMAGE include_tasks: tasks/image.yml vars: image_name: "MYOS 1" image_uuid: "{{ libvirt.compute_resource.image_uuid_2 }}" image_username: "myosadmin" image_operatingsystem: "MY2NDOS" image_compute_resource: "MYCR" image_architecture: "MY1024" image_state: present expected_change: false - name: Do not change MYIMAGE include_tasks: tasks/image.yml vars: image_name: "MYOS 1" image_uuid: "{{ libvirt.compute_resource.image_uuid }}" image_username: "myosadmin" image_operatingsystem: "MYOS SP1" image_compute_resource: "MYCR" image_architecture: "MY1024" image_state: present expected_change: false - name: Delete MYIMAGE include_tasks: tasks/image.yml vars: image_name: "MYOS 1" image_uuid: "{{ libvirt.compute_resource.image_uuid }}" image_username: "myosadmin" image_operatingsystem: "MYOS SP1" image_compute_resource: "MYCR" image_architecture: "MY1024" image_user_data: false image_state: absent expected_change: true - name: Delete MY2NDIMAGE include_tasks: tasks/image.yml vars: image_name: "MYOS 1" image_uuid: "{{ libvirt.compute_resource.image_uuid_2 }}" image_username: "myosadmin" image_operatingsystem: "MY2NDOS" image_compute_resource: "MYCR" image_architecture: "MY1024" image_state: absent expected_change: true - hosts: localhost collections: - theforeman.foreman gather_facts: false vars_files: - vars/server.yml tasks: - include_tasks: tasks/architecture.yml vars: operatingsystems: - "MYOS SP1" - "MY2NDOS" architecture_name: "MY1024" architecture_state: absent - include_tasks: tasks/operatingsystem.yml vars: operatingsystem_description: "MYOS SP1" operatingsystem_minor: 1 operatingsystem_state: absent - include_tasks: tasks/operatingsystem.yml vars: operatingsystem_description: "MY2NDOS" operatingsystem_minor: 1 operatingsystem_state: absent - include_tasks: tasks/compute_resource.yml vars: compute_resource_name: "MYCR" compute_resource_state: absent - include_tasks: tasks/location.yml vars: location_state: absent - include_tasks: tasks/organization.yml vars: organization_state: absent ...