Skip to content

Commit

Permalink
Merge pull request #91 from /issues/90
Browse files Browse the repository at this point in the history
Restart bridge interface after all ports restart
  • Loading branch information
markgoddard authored Dec 11, 2020
2 parents 0a3bd4c + 9849072 commit fe3a834
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions tasks/bridge_configuration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,33 @@
bridge_route_del_result.results | default([]) +
bridge_rule_add_result.results | default([]) +
bridge_rule_del_result.results | default([]) }}
# Find bridge interfaces which have all ports changed. We do this by
# excluding any bridges which have an unchanged port.
bridge_interfaces_with_all_ports_changed: >
{{ interfaces_bridge_interfaces |
map(attribute='device') |
difference(bridge_port_result.results |
reject('changed') |
map(attribute='item.0.device') |
list) |
list }}
# bridge_interfaces_changed and bridge_port_interfaces_changed are used in the
# 'Bounce network devices' handler.
- name: Set facts containing changed bridge and bridge port devices
set_fact:
# Select those tasks which changed, and map to a list of the corresponding
# bridge devices.
# On CentOS/RHEL 8 systems, if all ports of a bridge go down, the bridge
# interface will also go down. If the ports are brought back up again,
# the bridge interface does not automatically come back up. Add bridge
# interfaces which have all ports changed to the list.
bridge_interfaces_changed: >
{{ all_bridge_results |
select('changed') |
map(attribute='item.device') |
{{ (all_bridge_results |
select('changed') |
map(attribute='item.device') |
list +
bridge_interfaces_with_all_ports_changed) |
unique |
list }}
# Select those tasks which changed, and map to a list of the corresponding
Expand Down

0 comments on commit fe3a834

Please sign in to comment.