fabric: fix check for peer switch

This commit is contained in:
Timotej Lazar 2024-02-26 10:06:26 +01:00
parent 65c16dbc63
commit 5381fecaa4

View file

@ -12,7 +12,7 @@ iface {{ bond.name }}
{% endif %} {% endif %}
{#- If the peer shares a bond with the same name, generate a clag-id for it unless the bonded link is to peer itself. #} {#- If the peer shares a bond with the same name, generate a clag-id for it unless the bonded link is to peer itself. #}
{% if peer %} {% if peer is defined %}
{% set peer_members = hostvars[peer].interfaces {% set peer_members = hostvars[peer].interfaces
| selectattr('lag') | selectattr('lag.name', '==', bond.name) %} | selectattr('lag') | selectattr('lag.name', '==', bond.name) %}
{% if peer_members | iface_peer | reject('eq', inventory_hostname) %} {% if peer_members | iface_peer | reject('eq', inventory_hostname) %}