Skip to content

Commit 32490f6

Browse files
marcelmamularichm
authored andcommitted
ansible-core 2.19 update
1 parent aff4943 commit 32490f6

11 files changed

+47
-32
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ ha_cluster_resource_groups:
746746
This variable defines resource groups. The items are as follows:
747747

748748
* `id` (mandatory) - ID of a group.
749-
* `resources` (mandatory) - List of the group's resources. Each resource is
749+
* `resource_ids` (mandatory) - List of the group's resources. Each resource is
750750
referenced by its ID and the resources must be defined in
751751
[`ha_cluster_resource_primitives`](#ha_cluster_resource_primitives). At least
752752
one resource must be listed.

tasks/shell_crmsh/check-and-prepare-role-variables.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
(
3030
__nodes_from_options != (__nodes_from_options | unique)
3131
) or (
32-
__nodes_from_options | difference(__ha_cluster_all_node_names)
32+
__nodes_from_options | difference(__ha_cluster_all_node_names) | list | length > 0
3333
)
3434
3535
- name: Extract node options

tasks/shell_crmsh/create-and-push-cib.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@
163163
## Stonith levels - fencing_topology
164164
- name: Configure stonith levels - fencing_topology
165165
ansible.builtin.include_tasks: crm-cib-stonith-level.yml
166-
when: ha_cluster_stonith_levels
166+
when: ha_cluster_stonith_levels | length > 0
167167

168168
## Constraints
169169
- name: Configure resource location constraints
@@ -175,7 +175,7 @@
175175

176176
- name: Configure resource colocation constraints
177177
ansible.builtin.include_tasks: crm-cib-constraint-colocation.yml
178-
when: not constraint.resource_sets | d()
178+
when: constraint.resource_sets | d([]) | length == 0
179179
loop: "{{ ha_cluster_constraints_colocation }}"
180180
loop_control:
181181
index_var: constraint_index
@@ -185,15 +185,15 @@
185185
ansible.builtin.include_tasks: crm-cib-constraint-set.yml
186186
vars:
187187
constraint_type: colocation
188-
when: constraint.resource_sets | d()
188+
when: constraint.resource_sets | d([]) | length > 0
189189
loop: "{{ ha_cluster_constraints_colocation }}"
190190
loop_control:
191191
index_var: constraint_index
192192
loop_var: constraint
193193

194194
- name: Configure resource order constraints
195195
ansible.builtin.include_tasks: crm-cib-constraint-order.yml
196-
when: not constraint.resource_sets | d()
196+
when: constraint.resource_sets | d([]) | length == 0
197197
loop: "{{ ha_cluster_constraints_order }}"
198198
loop_control:
199199
index_var: constraint_index
@@ -203,15 +203,15 @@
203203
ansible.builtin.include_tasks: crm-cib-constraint-set.yml
204204
vars:
205205
constraint_type: order
206-
when: constraint.resource_sets | d()
206+
when: constraint.resource_sets | d([]) | length > 0
207207
loop: "{{ ha_cluster_constraints_order }}"
208208
loop_control:
209209
index_var: constraint_index
210210
loop_var: constraint
211211

212212
- name: Configure resource ticket constraints
213213
ansible.builtin.include_tasks: crm-cib-constraint-ticket.yml
214-
when: not constraint.resource_sets | d()
214+
when: constraint.resource_sets | d([]) | length == 0
215215
loop: "{{ ha_cluster_constraints_ticket }}"
216216
loop_control:
217217
index_var: constraint_index
@@ -221,7 +221,7 @@
221221
ansible.builtin.include_tasks: crm-cib-constraint-set.yml
222222
vars:
223223
constraint_type: ticket
224-
when: constraint.resource_sets | d()
224+
when: constraint.resource_sets | d([]) | length > 0
225225
loop: "{{ ha_cluster_constraints_ticket }}"
226226
loop_control:
227227
index_var: constraint_index
@@ -232,7 +232,9 @@
232232
ansible.builtin.include_tasks: crm-cluster-properties.yml
233233
vars:
234234
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
236238

237239
# Verify CIB to ensure that there are no errors before applying.
238240
- name: Verify shadow CIB

tasks/shell_crmsh/crm-cib-constraint-colocation.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,14 @@
6262
{% else %}
6363
inf: \
6464
{% endfor %}
65-
{% if constraint.resource_follower.role | d() and
65+
{% if constraint.resource_follower.role is defined and
6666
constraint.resource_follower.role | lower in __ha_cluster_crmsh_roles %}
6767
{{ constraint.resource_follower.id | quote }}:{{
6868
constraint.resource_follower.role | lower | capitalize | quote }} \
6969
{% else %}
7070
{{ constraint.resource_follower.id | quote }} \
7171
{% endif %}
72-
{% if constraint.resource_leader.role | d() and
72+
{% if constraint.resource_leader.role is defined and
7373
constraint.resource_leader.role | lower in __ha_cluster_crmsh_roles %}
7474
{{ constraint.resource_leader.id | quote }}:{{
7575
constraint.resource_leader.role | lower | capitalize | quote }} \

tasks/shell_crmsh/crm-cib-constraint-location.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,18 @@
5050
cmd: >-
5151
yes 'n' | crm -c {{ __ha_cluster_crm_shadow }}
5252
configure location {{ __ha_cluster_constraint_id }}
53-
{%- if constraint.resource.pattern | d() %}
53+
{%- if constraint.resource.pattern is defined %}
5454
/{{ constraint.resource.pattern | quote }}/
5555
{%- else %}
5656
{{ constraint.resource.id | quote }}
5757
{%- endif %}
58-
{%- if constraint.resource.role | d() and
58+
{%- if constraint.resource.role is defined and
5959
constraint.resource.role | lower in __ha_cluster_crmsh_roles %}
6060
role={{
6161
constraint.resource.role | lower | capitalize | quote
6262
}}
6363
{%- endif %}
64-
{%- if constraint.rule | d() %}
64+
{%- if constraint.rule is defined %}
6565
rule {{ __score }}{{ constraint.rule }}
6666
{%- else %}
6767
{{ __score }} {{ constraint.node }}

tasks/shell_crmsh/crm-cib-constraint-set.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
{%- endif %}
9292
{{ __ha_cluster_resource_ids_string }}
9393
{%- else %}
94-
{%- for set in constraint.resource_sets %}
94+
{%- for set in constraint.resource_sets | d([]) %}
9595
{{ constraint.ticket | quote }}: {{ __ha_cluster_resource_ids_string }}
9696
{%- endfor %}
9797
{%- endif %}

tasks/shell_crmsh/crm-cib-constraint-ticket.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@
4545
ansible.builtin.shell:
4646
cmd: |
4747
yes 'n' | crm -c {{ __ha_cluster_crm_shadow }} configure rsc_ticket \
48-
{{ __ha_cluster_constraint_id }} {{ constraint.ticket | quote }}: \
49-
{% if constraint.resource.role | d() and
48+
{{ __ha_cluster_constraint_id }} {{ constraint.ticket | quote }}: \
49+
{% if constraint.resource.role is defined and
5050
constraint.resource.role | lower in __ha_cluster_crmsh_roles %}
5151
{{ constraint.resource.id | quote }}:{{
5252
constraint.resource.role | lower | capitalize | quote }} \

tasks/shell_crmsh/crm-cib-resource-clone.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,10 @@
5353
ms {% else %} clone {% endif %} \
5454
{{ __ha_cluster_resource_id }} \
5555
{{ resource_clone.resource_id | quote }} \
56-
{% if resource_clone.meta_attrs[0].attrs | default(False) %}
56+
{% if resource_clone.meta_attrs is defined
57+
and resource_clone.meta_attrs | type_debug == 'list'
58+
and resource_clone.meta_attrs[0].attrs is defined
59+
and resource_clone.meta_attrs[0].attrs | type_debug == 'list' %}
5760
meta {% for attr in resource_clone.meta_attrs[0].attrs -%}
5861
{{ attr.name | quote }}={{ attr.value | quote }} \
5962
{% endfor %}

tasks/shell_crmsh/crm-cib-resource-group.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,14 @@
4040
ansible.builtin.shell:
4141
cmd: |
4242
yes 'n' | crm -c {{ __ha_cluster_crm_shadow }} configure group \
43-
{{ resource_group.id | quote }} \
43+
{{ resource_group.id | quote }} \
4444
{% for resource in resource_group.resource_ids %}
4545
{{ resource | quote }} \
4646
{% endfor %}
47-
{% if resource_group.meta_attrs[0].attrs | default(False) %}
47+
{% if resource_group.meta_attrs is defined
48+
and resource_group.meta_attrs | type_debug == 'list'
49+
and resource_group.meta_attrs[0].attrs is defined
50+
and resource_group.meta_attrs[0].attrs | type_debug == 'list' %}
4851
meta {% for attr in resource_group.meta_attrs[0].attrs -%}
4952
{{ attr.name | quote }}={{ attr.value | quote }} \
5053
{% endfor %}

tasks/shell_crmsh/crm-cib-resource-primitive.yml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,25 +26,32 @@
2626
cmd: |
2727
yes 'n' | crm -c {{ __ha_cluster_crm_shadow }} configure primitive \
2828
{{ resource.id | quote }} {{ resource.agent | quote }} \
29-
{% if resource.instance_attrs[0].attrs | default(False) %}
29+
{% if resource.instance_attrs is defined
30+
and resource.instance_attrs | type_debug == 'list'
31+
and resource.instance_attrs[0].attrs is defined
32+
and resource.instance_attrs[0].attrs | type_debug == 'list' %}
3033
params {% for attr in resource.instance_attrs[0].attrs -%}
3134
{{ attr.name | quote }}={{ attr.value | quote }} \
3235
{% endfor %}
3336
{% endif %}
34-
{% if resource.meta_attrs[0].attrs | default(False) %}
37+
{% if resource.meta_attrs is defined
38+
and resource.meta_attrs | type_debug == 'list'
39+
and resource.meta_attrs[0].attrs is defined
40+
and resource.meta_attrs[0].attrs | type_debug == 'list' %}
3541
meta {% for attr in resource.meta_attrs[0].attrs -%}
3642
{{ attr.name | quote }}={{ attr.value | quote }} \
3743
{% endfor %}
3844
{% endif %}
39-
{% if resource.operations | default(False) %}\
45+
{% if resource.operations is defined
46+
and resource.operations | type_debug == 'list' %}\
4047
{% for operation in resource.operations %}
41-
{% if operation.action | default(False) %}
48+
{% if operation.action is defined
49+
and operation.attrs is defined
50+
and operation.attrs | type_debug == 'list' %}
4251
op {{ operation.action | quote }} \
43-
{% if operation.attrs | default(False) %}
44-
{%- for attr in operation.attrs -%}
45-
{{ attr.name | quote }}={{ attr.value | quote }} \
46-
{% endfor %}
47-
{% endif %}
52+
{%- for attr in operation.attrs -%}
53+
{{ attr.name | quote }}={{ attr.value | quote }} \
54+
{% endfor %}
4855
{% endif %}
4956
{% endfor %}
5057
{% endif %}

0 commit comments

Comments
 (0)