| 1 | --- |
| 2 | - hosts: localhost |
| 3 | collections: |
| 4 | - theforeman.foreman |
| 5 | gather_facts: false |
| 6 | vars_files: |
| 7 | - vars/server.yml |
| 8 | tasks: |
| 9 | - include_tasks: tasks/organization.yml |
| 10 | vars: |
| 11 | organization_state: present |
| 12 | - include_tasks: tasks/location.yml |
| 13 | vars: |
| 14 | location_state: present |
| 15 | |
| 16 | - hosts: tests |
| 17 | collections: |
| 18 | - theforeman.foreman |
| 19 | gather_facts: false |
| 20 | vars_files: |
| 21 | - vars/server.yml |
| 22 | tasks: |
| 23 | - include_tasks: tasks/ptable.yml |
| 24 | vars: |
| 25 | ptable_state: present |
| 26 | expected_change: true |
| 27 | - include_tasks: tasks/ptable.yml |
| 28 | vars: |
| 29 | ptable_state: present |
| 30 | expected_change: false |
| 31 | - include_tasks: tasks/ptable.yml |
| 32 | vars: |
| 33 | ptable_state: present |
| 34 | locked_state: false |
| 35 | expected_change: false |
| 36 | - include_tasks: tasks/ptable.yml |
| 37 | vars: |
| 38 | ptable_state: present |
| 39 | locked_state: true |
| 40 | expected_change: true |
| 41 | - include_tasks: tasks/ptable.yml |
| 42 | vars: |
| 43 | ptable_state: present |
| 44 | locked_state: true |
| 45 | expected_change: false |
| 46 | - include_tasks: tasks/ptable.yml |
| 47 | vars: |
| 48 | ptable_state: present |
| 49 | expected_change: false |
| 50 | - include_tasks: tasks/ptable.yml |
| 51 | vars: |
| 52 | ptable_state: present |
| 53 | locked_state: false |
| 54 | expected_change: true |
| 55 | - include_tasks: tasks/ptable.yml |
| 56 | vars: |
| 57 | ptable_layout: 'A partition table with a changed layout' |
| 58 | ptable_state: present |
| 59 | expected_change: true |
| 60 | - name: add ptable |
| 61 | include_tasks: tasks/ptable.yml |
| 62 | vars: |
| 63 | ptable_name: 'A partition table 2' |
| 64 | ptable_layout: | |
| 65 | zerombr |
| 66 | clearpart --all --initlabel |
| 67 | autopart |
| 68 | ptable_state: present |
| 69 | expected_change: true |
| 70 | - name: change ptable name |
| 71 | include_tasks: tasks/ptable.yml |
| 72 | vars: |
| 73 | ptable_name: 'A partition table 2' |
| 74 | ptable_updated_name: 'A partition table 3' |
| 75 | ptable_layout: | |
| 76 | zerombr |
| 77 | clearpart --all --initlabel |
| 78 | autopart |
| 79 | ptable_state: present |
| 80 | expected_change: true |
| 81 | - include_tasks: tasks/ptable.yml |
| 82 | vars: |
| 83 | ptable_name: 'A partition table 3' |
| 84 | ptable_layout: | |
| 85 | zerombr |
| 86 | clearpart --all --initlabel |
| 87 | autopart |
| 88 | ptable_state: present |
| 89 | expected_change: false |
| 90 | - include_tasks: tasks/ptable.yml |
| 91 | vars: |
| 92 | ptable_name: 'A partition table 3' |
| 93 | ptable_state: absent |
| 94 | expected_change: true |
| 95 | - name: add ptable without location |
| 96 | include_tasks: tasks/ptable.yml |
| 97 | vars: |
| 98 | ptable_name: 'A second partition table' |
| 99 | ptable_locations: "{{ omit }}" |
| 100 | ptable_layout: | |
| 101 | zerombr |
| 102 | clearpart --all --initlabel |
| 103 | autopart |
| 104 | ptable_state: present |
| 105 | expected_change: true |
| 106 | - include_tasks: tasks/ptable.yml |
| 107 | vars: |
| 108 | ptable_state: absent |
| 109 | expected_change: true |
| 110 | - include_tasks: tasks/ptable.yml |
| 111 | vars: |
| 112 | ptable_state: absent |
| 113 | expected_change: false |
| 114 | - name: set location of all ptables |
| 115 | include_tasks: tasks/ptable.yml |
| 116 | vars: |
| 117 | ptable_name: '*' |
| 118 | ptable_organizations: "{{ omit }}" |
| 119 | ptable_layout: "{{ omit }}" |
| 120 | ptable_state: present |
| 121 | expected_change: true |
| 122 | - name: set location of all ptables |
| 123 | include_tasks: tasks/ptable.yml |
| 124 | vars: |
| 125 | ptable_name: '*' |
| 126 | ptable_organizations: "{{ omit }}" |
| 127 | ptable_layout: "{{ omit }}" |
| 128 | ptable_state: present |
| 129 | expected_change: false |
| 130 | - name: unlock all ptables |
| 131 | include_tasks: tasks/ptable.yml |
| 132 | vars: |
| 133 | ptable_name: '*' |
| 134 | locked_state: false |
| 135 | ptable_location: "{{ omit }}" |
| 136 | ptable_organizations: "{{ omit }}" |
| 137 | ptable_layout: "{{ omit }}" |
| 138 | ptable_state: present |
| 139 | expected_change: true |
| 140 | - name: unlock all ptables |
| 141 | include_tasks: tasks/ptable.yml |
| 142 | vars: |
| 143 | ptable_name: '*' |
| 144 | locked_state: false |
| 145 | ptable_location: "{{ omit }}" |
| 146 | ptable_organizations: "{{ omit }}" |
| 147 | ptable_layout: "{{ omit }}" |
| 148 | ptable_state: present |
| 149 | expected_change: false |
| 150 | - name: delete all ptables |
| 151 | include_tasks: tasks/ptable.yml |
| 152 | vars: |
| 153 | ptable_name: '*' |
| 154 | ptable_locations: "{{ omit }}" |
| 155 | ptable_organizations: "{{ omit }}" |
| 156 | ptable_layout: "{{ omit }}" |
| 157 | ptable_state: absent |
| 158 | expected_change: true |
| 159 | - name: delete all ptables |
| 160 | include_tasks: tasks/ptable.yml |
| 161 | vars: |
| 162 | ptable_name: '*' |
| 163 | ptable_locations: "{{ omit }}" |
| 164 | ptable_organizations: "{{ omit }}" |
| 165 | ptable_layout: "{{ omit }}" |
| 166 | ptable_state: absent |
| 167 | expected_change: false |
| 168 | |
| 169 | - hosts: localhost |
| 170 | collections: |
| 171 | - theforeman.foreman |
| 172 | gather_facts: false |
| 173 | vars_files: |
| 174 | - vars/server.yml |
| 175 | tasks: |
| 176 | - include_tasks: tasks/location.yml |
| 177 | vars: |
| 178 | location_state: absent |
| 179 | - include_tasks: tasks/organization.yml |
| 180 | vars: |
| 181 | organization_state: absent |
| 182 | ... |