| 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 | tasks: |
| 10 | - include_tasks: tasks/organization.yml |
| 11 | vars: |
| 12 | organization_state: present |
| 13 | - include_tasks: tasks/location.yml |
| 14 | vars: |
| 15 | location_state: present |
| 16 | - include_tasks: tasks/compute_resource.yml |
| 17 | vars: |
| 18 | compute_resource_name: "{{ libvirt.compute_resource.name }}" |
| 19 | compute_resource_organizations: "{{ libvirt.compute_resource.organizations }}" |
| 20 | compute_resource_locations: "{{ libvirt.compute_resource.locations }}" |
| 21 | compute_resource_provider: 'libvirt' |
| 22 | compute_resource_provider_params: "{{ libvirt.compute_resource.params }}" |
| 23 | compute_resource_state: present |
| 24 | - include_tasks: tasks/compute_profile.yml |
| 25 | vars: |
| 26 | compute_profile_state: absent |
| 27 | - include_tasks: tasks/compute_profile.yml |
| 28 | vars: |
| 29 | compute_profile_name: app-small |
| 30 | compute_profile_state: absent |
| 31 | |
| 32 | - hosts: tests |
| 33 | collections: |
| 34 | - theforeman.foreman |
| 35 | gather_facts: false |
| 36 | vars_files: |
| 37 | - vars/server.yml |
| 38 | - vars/compute_profile.yml |
| 39 | tasks: |
| 40 | - include_tasks: tasks/compute_profile.yml |
| 41 | vars: |
| 42 | compute_profile_state: present |
| 43 | expected_change: true |
| 44 | - include_tasks: tasks/compute_profile.yml |
| 45 | vars: |
| 46 | compute_profile_state: present |
| 47 | expected_change: false |
| 48 | - include_tasks: tasks/compute_profile.yml |
| 49 | vars: |
| 50 | compute_profile_state: absent |
| 51 | expected_change: true |
| 52 | - include_tasks: tasks/compute_profile.yml |
| 53 | vars: |
| 54 | compute_profile_state: absent |
| 55 | expected_change: false |
| 56 | - include_tasks: tasks/compute_profile.yml |
| 57 | vars: |
| 58 | compute_profile_name: app-small |
| 59 | compute_profile_attributes: |
| 60 | - compute_resource: "{{ libvirt.compute_resource.name }}" |
| 61 | vm_attrs: "{{ libvirt.compute_profile.attrs }}" |
| 62 | compute_profile_state: present |
| 63 | expected_change: true |
| 64 | expected_diff: true |
| 65 | expected_diff_before: "{}" |
| 66 | expected_diff_after: "model.*virtio" |
| 67 | - include_tasks: tasks/compute_profile.yml |
| 68 | vars: |
| 69 | compute_profile_name: app-small |
| 70 | compute_profile_attributes: |
| 71 | - compute_resource: "{{ libvirt.compute_resource.name }}" |
| 72 | vm_attrs: "{{ libvirt.compute_profile.attrs }}" |
| 73 | compute_profile_state: present |
| 74 | expected_change: false |
| 75 | - include_tasks: tasks/compute_profile.yml |
| 76 | vars: |
| 77 | compute_profile_name: app-small |
| 78 | compute_profile_attributes: |
| 79 | - compute_resource: "{{ libvirt.compute_resource.name }}" |
| 80 | vm_attrs: "{{ libvirt.compute_profile.attrs | combine({'cpus':2}) }}" |
| 81 | compute_profile_state: present |
| 82 | expected_change: true |
| 83 | - include_tasks: tasks/compute_profile.yml |
| 84 | vars: |
| 85 | compute_profile_name: app-small |
| 86 | compute_profile_attributes: |
| 87 | - compute_resource: "{{ libvirt.compute_resource.name }}" |
| 88 | vm_attrs: "{{ libvirt.compute_profile.attrs | combine({'cpus':2}) }}" |
| 89 | compute_profile_state: present |
| 90 | expected_change: false |
| 91 | - include_tasks: tasks/compute_profile.yml |
| 92 | vars: |
| 93 | compute_profile_name: app-small |
| 94 | compute_profile_state: absent |
| 95 | expected_change: true |
| 96 | |
| 97 | - hosts: localhost |
| 98 | collections: |
| 99 | - theforeman.foreman |
| 100 | gather_facts: false |
| 101 | vars_files: |
| 102 | - vars/server.yml |
| 103 | - vars/compute_profile.yml |
| 104 | tasks: |
| 105 | - include_tasks: tasks/compute_resource.yml |
| 106 | vars: |
| 107 | compute_resource_name: "{{ libvirt.compute_resource.name }}" |
| 108 | compute_resource_state: absent |
| 109 | - include_tasks: tasks/location.yml |
| 110 | vars: |
| 111 | location_state: absent |
| 112 | - include_tasks: tasks/organization.yml |
| 113 | vars: |
| 114 | organization_state: absent |
| 115 | ... |