diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/group_vars/MLAG_ISIS_TESTS.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/group_vars/MLAG_ISIS_TESTS.yml index 17f1bb5d007..e45d5785a55 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/group_vars/MLAG_ISIS_TESTS.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/group_vars/MLAG_ISIS_TESTS.yml @@ -3,7 +3,6 @@ underlay_routing_protocol: isis underlay_isis_authentication_mode: md5 underlay_isis_authentication_key: $1c$sTNAlR6rKSw= - type: l3leaf l3leaf: diff --git a/python-avd/pyavd/_eos_designs/structured_config/mlag/__init__.py b/python-avd/pyavd/_eos_designs/structured_config/mlag/__init__.py index 0777cc4f154..34e0cba7b66 100644 --- a/python-avd/pyavd/_eos_designs/structured_config/mlag/__init__.py +++ b/python-avd/pyavd/_eos_designs/structured_config/mlag/__init__.py @@ -108,16 +108,18 @@ def vlan_interfaces(self) -> list | None: "isis_bfd": get(self._hostvars, "underlay_isis_bfd"), "isis_metric": 50, "isis_network_point_to_point": True, - "isis_authentication": { - "both": { - "mode": get(self._hostvars, "underlay_isis_authentication_mode"), - "key": get(self._hostvars, "underlay_isis_authentication_key"), - "key_type": "7", - } - }, } ) + if (isis_authentication_mode := get(self._hostvars, "underlay_isis_authentication_mode")) is not None: + l3_cfg.setdefault("isis_authentication", {}).setdefault("both", {})["mode"] = isis_authentication_mode + if (isis_authentication_key := get(self._hostvars, "underlay_isis_authentication_key")) is not None: + l3_cfg.setdefault("isis_authentication", {}).setdefault("both", {}).update( + { + "key": isis_authentication_key, + "key_type": "7", + } + ) if self.shared_utils.underlay_multicast: l3_cfg["pim"] = {"ipv4": {"sparse_mode": True}}