|
163 | 163 | ## Stonith levels - fencing_topology |
164 | 164 | - name: Configure stonith levels - fencing_topology |
165 | 165 | ansible.builtin.include_tasks: crm-cib-stonith-level.yml |
166 | | - when: ha_cluster_stonith_levels |
| 166 | + when: ha_cluster_stonith_levels | length > 0 |
167 | 167 |
|
168 | 168 | ## Constraints |
169 | 169 | - name: Configure resource location constraints |
|
175 | 175 |
|
176 | 176 | - name: Configure resource colocation constraints |
177 | 177 | ansible.builtin.include_tasks: crm-cib-constraint-colocation.yml |
178 | | - when: not constraint.resource_sets | d() |
| 178 | + when: constraint.resource_sets | d([]) | length == 0 |
179 | 179 | loop: "{{ ha_cluster_constraints_colocation }}" |
180 | 180 | loop_control: |
181 | 181 | index_var: constraint_index |
|
185 | 185 | ansible.builtin.include_tasks: crm-cib-constraint-set.yml |
186 | 186 | vars: |
187 | 187 | constraint_type: colocation |
188 | | - when: constraint.resource_sets | d() |
| 188 | + when: constraint.resource_sets | d([]) | length > 0 |
189 | 189 | loop: "{{ ha_cluster_constraints_colocation }}" |
190 | 190 | loop_control: |
191 | 191 | index_var: constraint_index |
192 | 192 | loop_var: constraint |
193 | 193 |
|
194 | 194 | - name: Configure resource order constraints |
195 | 195 | ansible.builtin.include_tasks: crm-cib-constraint-order.yml |
196 | | - when: not constraint.resource_sets | d() |
| 196 | + when: constraint.resource_sets | d([]) | length == 0 |
197 | 197 | loop: "{{ ha_cluster_constraints_order }}" |
198 | 198 | loop_control: |
199 | 199 | index_var: constraint_index |
|
203 | 203 | ansible.builtin.include_tasks: crm-cib-constraint-set.yml |
204 | 204 | vars: |
205 | 205 | constraint_type: order |
206 | | - when: constraint.resource_sets | d() |
| 206 | + when: constraint.resource_sets | d([]) | length > 0 |
207 | 207 | loop: "{{ ha_cluster_constraints_order }}" |
208 | 208 | loop_control: |
209 | 209 | index_var: constraint_index |
210 | 210 | loop_var: constraint |
211 | 211 |
|
212 | 212 | - name: Configure resource ticket constraints |
213 | 213 | ansible.builtin.include_tasks: crm-cib-constraint-ticket.yml |
214 | | - when: not constraint.resource_sets | d() |
| 214 | + when: constraint.resource_sets | d([]) | length == 0 |
215 | 215 | loop: "{{ ha_cluster_constraints_ticket }}" |
216 | 216 | loop_control: |
217 | 217 | index_var: constraint_index |
|
221 | 221 | ansible.builtin.include_tasks: crm-cib-constraint-set.yml |
222 | 222 | vars: |
223 | 223 | constraint_type: ticket |
224 | | - when: constraint.resource_sets | d() |
| 224 | + when: constraint.resource_sets | d([]) | length > 0 |
225 | 225 | loop: "{{ ha_cluster_constraints_ticket }}" |
226 | 226 | loop_control: |
227 | 227 | index_var: constraint_index |
|
232 | 232 | ansible.builtin.include_tasks: crm-cluster-properties.yml |
233 | 233 | vars: |
234 | 234 | properties_set: "{{ ha_cluster_cluster_properties[0] }}" |
235 | | - when: ha_cluster_cluster_properties[0].attrs | d([]) |
| 235 | + when: |
| 236 | + - ha_cluster_cluster_properties[0].attrs | d(none) is not none |
| 237 | + - ha_cluster_cluster_properties[0].attrs | length > 0 |
236 | 238 |
|
237 | 239 | # Verify CIB to ensure that there are no errors before applying. |
238 | 240 | - name: Verify shadow CIB |
|
0 commit comments