Hi,
Here the issuing part of code:
- name: "Check aggregated interface configuration and save the differences"
ansible.builtin.set_fact:
aggregated_interface_configuration_difference: "{{ lines | difference(r_aggregated_interface_configuration.stdout_lines | first) }}"
vars:
lines:
- inherit port-profile RLB-CLIENT-TRUNK-PO-MEMBER-10G
- " description PZB-{{ server_serial_number }}-{{ pizza_box_name }}"
- " channel-group {{ port_channel_id }}"
- " no snmp trap link-status"
- name: "Check difference between the configuration of interfaces and targets configurations"
ansible.builtin.assert:
that:
- (po_configuration_difference | length) == 0
- (aggregated_interface_configuration_difference | length) == 0
fail_msg: "Port-channel for {{ server_serial_number }}-{{ pizza_box_name }} duo already exists with wrong configuration, cannot create new configuration"
- name: "Close session if port-channel and interfaces configurations are correct"
ansible.builtin.meta: end_play
- name: "Validate discovered interfaces"
run_once: yes
delegate_to: localhost
any_errors_fatal: yes
vars:
all_switches_interfaces: "{{
hostvars
| dict2items(key_name='host', value_name='hostvars')
| selectattr('hostvars.interface_without_po_set', 'defined')
| map(attribute='hostvars.interface_without_po_set')
| list
| flatten
}}"
......
Here, the result:
TASK [Check aggregated interface configuration and save the differences] *******
skipping: [SWITCH56]
skipping: [SWITCH55]
skipping: [SWITCH58]
skipping: [SWITCH57]
skipping: [SWITCH65]
skipping: [SWITCH66]
ok: [SWITCH64]
ok: [SWITCH63]
TASK [Check difference between the configuration of interfaces and targets configurations] ***
skipping: [SWITCH56]
skipping: [SWITCH55]
skipping: [SWITCH57]
skipping: [SWITCH58]
skipping: [SWITCH66]
skipping: [SWITCH65]
ok: [SWITCH64] => {
"changed": false,
"msg": "All assertions passed"
}
ok: [SWITCH63] => {
"changed": false,
"msg": "All assertions passed"
}
TASK [Validate discovered switch interfaces from switch-side MAC addresses] ****
ok: [SWITCH56 -> localhost]
As you can see, the task Check difference between the configuration of interfaces and targets configurations is successfull so just after that the meta end play must stop the execution but the playbook continues and the next task Validate discovered switch interfaces from switch-side MAC addresses is played.
So I don't understand.
Best Regards,
Folio Brice Roland