diff --git a/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/port-channel-interfaces.j2 b/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/port-channel-interfaces.j2 index a505425419e..4fccc22f83c 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/port-channel-interfaces.j2 +++ b/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/port-channel-interfaces.j2 @@ -384,14 +384,18 @@ {% set isis_hello_padding = port_channel_interface.isis_hello_padding | arista.avd.default("-") %} {% if port_channel_interface.isis_authentication_mode is arista.avd.defined %} {% set isis_authentication_mode = port_channel_interface.isis_authentication_mode %} -{% elif port_channel_interface.isis_authentication.both.mode is arista.avd.defined %} -{% set isis_authentication_mode = port_channel_interface.isis_authentication.both.mode %} -{% elif port_channel_interface.isis_authentication.level_1.mode is arista.avd.defined and port_channel_interface.isis_authentication.level_2.mode is arista.avd.defined %} -{% set isis_authentication_mode = "Level-1: " ~ port_channel_interface.isis_authentication.level_1.mode ~ "
" ~ "Level-2: " ~ port_channel_interface.isis_authentication.level_2.mode %} -{% elif port_channel_interface.isis_authentication.level_1.mode is arista.avd.defined %} -{% set isis_authentication_mode = "Level-1: " ~ port_channel_interface.isis_authentication.level_1.mode %} -{% elif port_channel_interface.isis_authentication.level_2.mode is arista.avd.defined %} -{% set isis_authentication_mode = "Level-1: " ~ port_channel_interface.isis_authentication.level_1.mode %} +{% else %} +{% if port_channel_interface.isis_authentication.both.mode is arista.avd.defined %} +{% set isis_authentication_mode = port_channel_interface.isis_authentication.both.mode %} +{% else %} +{% if port_channel_interface.isis_authentication.level_1.mode is arista.avd.defined and port_channel_interface.isis_authentication.level_2.mode is arista.avd.defined %} +{% set isis_authentication_mode = "Level-1: " ~ port_channel_interface.isis_authentication.level_1.mode ~ "
" ~ "Level-2: " ~ port_channel_interface.isis_authentication.level_2.mode %} +{% elif port_channel_interface.isis_authentication.level_1.mode is arista.avd.defined %} +{% set isis_authentication_mode = "Level-1: " ~ port_channel_interface.isis_authentication.level_1.mode %} +{% elif port_channel_interface.isis_authentication.level_2.mode is arista.avd.defined %} +{% set isis_authentication_mode = "Level-1: " ~ port_channel_interface.isis_authentication.level_1.mode %} +{% endif %} +{% endif %} {% endif %} {% if port_channel_interface.isis_network_point_to_point is arista.avd.defined(true) %} {% set mode = "point-to-point" %} diff --git a/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/port-channel-interfaces.j2 b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/port-channel-interfaces.j2 index ff159c2ac8c..e1840bc1764 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/port-channel-interfaces.j2 +++ b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/port-channel-interfaces.j2 @@ -683,15 +683,12 @@ interface {{ port_channel_interface.name }} {% if port_channel_interface.isis_authentication.both.mode is arista.avd.defined and (port_channel_interface.isis_authentication.both.mode in ["md5", "text"] or (port_channel_interface.isis_authentication.both.mode == "sha" and port_channel_interface.isis_authentication.both.sha.key_id is arista.avd.defined) - or (port_channel_interface.isis_authentication.both.mode == "shared-secret" - and port_channel_interface.isis_authentication.both.shared_secret.profile is arista.avd.defined - and port_channel_interface.isis_authentication.both.shared_secret.algorithm is arista.avd.defined)) %} + or (port_channel_interface.isis_authentication.both.mode == "shared-secret" and port_channel_interface.isis_authentication.both.shared_secret is arista.avd.defined)) %} {% set isis_auth_cli = "isis authentication mode " ~ port_channel_interface.isis_authentication.both.mode %} {% if port_channel_interface.isis_authentication.both.mode == "sha" %} {% set isis_auth_cli = isis_auth_cli ~ " key-id " ~ port_channel_interface.isis_authentication.both.sha.key_id %} {% elif port_channel_interface.isis_authentication.both.mode == "shared-secret" %} -{% set isis_auth_cli = isis_auth_cli ~ " profile " ~ port_channel_interface.isis_authentication.both.shared_secret.profile %} -{% set isis_auth_cli = isis_auth_cli ~ " algorithm " ~ port_channel_interface.isis_authentication.both.shared_secret.algorithm %} +{% set isis_auth_cli = isis_auth_cli ~ " profile " ~ port_channel_interface.isis_authentication.both.shared_secret.profile ~ " algorithm " ~ port_channel_interface.isis_authentication.both.shared_secret.algorithm %} {% endif %} {% if port_channel_interface.isis_authentication.both.rx_disabled is arista.avd.defined(true) %} {% set isis_auth_cli = isis_auth_cli ~ " rx-disabled" %} @@ -701,15 +698,12 @@ interface {{ port_channel_interface.name }} {% if port_channel_interface.isis_authentication.level_1.mode is arista.avd.defined and (port_channel_interface.isis_authentication.level_1.mode in ["md5", "text"] or (port_channel_interface.isis_authentication.level_1.mode == "sha" and port_channel_interface.isis_authentication.level_1.sha.key_id is arista.avd.defined) - or (port_channel_interface.isis_authentication.level_1.mode == "shared-secret" - and port_channel_interface.isis_authentication.level_1.shared_secret.profile is arista.avd.defined - and port_channel_interface.isis_authentication.level_1.shared_secret.algorithm is arista.avd.defined)) %} + or (port_channel_interface.isis_authentication.level_1.mode == "shared-secret" and port_channel_interface.isis_authentication.level_1.shared_secret is arista.avd.defined)) %} {% set isis_auth_cli = "isis authentication mode " ~ port_channel_interface.isis_authentication.level_1.mode %} {% if port_channel_interface.isis_authentication.level_1.mode == "sha" %} {% set isis_auth_cli = isis_auth_cli ~ " key-id " ~ port_channel_interface.isis_authentication.level_1.sha.key_id %} {% elif port_channel_interface.isis_authentication.level_1.mode == "shared-secret" %} -{% set isis_auth_cli = isis_auth_cli ~ " profile " ~ port_channel_interface.isis_authentication.level_1.shared_secret.profile %} -{% set isis_auth_cli = isis_auth_cli ~ " algorithm " ~ port_channel_interface.isis_authentication.level_1.shared_secret.algorithm %} +{% set isis_auth_cli = isis_auth_cli ~ " profile " ~ port_channel_interface.isis_authentication.level_1.shared_secret.profile ~ " algorithm " ~ port_channel_interface.isis_authentication.level_1.shared_secret.algorithm %} {% endif %} {% if port_channel_interface.isis_authentication.level_1.rx_disabled is arista.avd.defined(true) %} {% set isis_auth_cli = isis_auth_cli ~ " rx-disabled" %} @@ -719,15 +713,12 @@ interface {{ port_channel_interface.name }} {% if port_channel_interface.isis_authentication.level_2.mode is arista.avd.defined and (port_channel_interface.isis_authentication.level_2.mode in ["md5", "text"] or (port_channel_interface.isis_authentication.level_2.mode == "sha" and port_channel_interface.isis_authentication.level_2.sha.key_id is arista.avd.defined) - or (port_channel_interface.isis_authentication.level_2.mode == "shared-secret" - and port_channel_interface.isis_authentication.level_2.shared_secret.profile is arista.avd.defined - and port_channel_interface.isis_authentication.level_2.shared_secret.algorithm is arista.avd.defined)) %} + or (port_channel_interface.isis_authentication.level_2.mode == "shared-secret" and port_channel_interface.isis_authentication.level_2.shared_secret is arista.avd.defined)) %} {% set isis_auth_cli = "isis authentication mode " ~ port_channel_interface.isis_authentication.level_2.mode %} {% if port_channel_interface.isis_authentication.level_2.mode == "sha" %} {% set isis_auth_cli = isis_auth_cli ~ " key-id " ~ port_channel_interface.isis_authentication.level_2.sha.key_id %} {% elif port_channel_interface.isis_authentication.level_2.mode == "shared-secret" %} -{% set isis_auth_cli = isis_auth_cli ~ " profile " ~ port_channel_interface.isis_authentication.level_2.shared_secret.profile %} -{% set isis_auth_cli = isis_auth_cli ~ " algorithm " ~ port_channel_interface.isis_authentication.level_2.shared_secret.algorithm %} +{% set isis_auth_cli = isis_auth_cli ~ " profile " ~ port_channel_interface.isis_authentication.level_2.shared_secret.profile ~ " algorithm " ~ port_channel_interface.isis_authentication.level_2.shared_secret.algorithm %} {% endif %} {% if port_channel_interface.isis_authentication.level_2.rx_disabled is arista.avd.defined(true) %} {% set isis_auth_cli = isis_auth_cli ~ " rx-disabled" %} @@ -739,26 +730,17 @@ interface {{ port_channel_interface.name }} {% set both_key_ids = [] %} {% if port_channel_interface.isis_authentication.both.key_ids is arista.avd.defined %} {% for auth_key in port_channel_interface.isis_authentication.both.key_ids | arista.avd.natural_sort("id") %} -{% if auth_key.id is arista.avd.defined - and auth_key.algorithm is arista.avd.defined - and auth_key.key_type is arista.avd.defined - and auth_key.key is arista.avd.defined %} -{% do both_key_ids.append(auth_key.id) %} -{% if auth_key.rfc_5310 is arista.avd.defined(true) %} +{% do both_key_ids.append(auth_key.id) %} +{% if auth_key.rfc_5310 is arista.avd.defined(true) %} isis authentication key-id {{ auth_key.id }} algorithm {{ auth_key.algorithm }} rfc-5310 key {{ auth_key.key_type }} {{ auth_key.key }} -{% else %} +{% else %} isis authentication key-id {{ auth_key.id }} algorithm {{ auth_key.algorithm }} key {{ auth_key.key_type }} {{ auth_key.key }} -{% endif %} {% endif %} {% endfor %} {% endif %} {% if port_channel_interface.isis_authentication.level_1.key_ids is arista.avd.defined %} -{% for auth_key in port_channel_interface.isis_authentication.level_1.key_ids %} -{% if auth_key.id is arista.avd.defined - and auth_key.id not in both_key_ids - and auth_key.algorithm is arista.avd.defined - and auth_key.key_type is arista.avd.defined - and auth_key.key is arista.avd.defined %} +{% for auth_key in port_channel_interface.isis_authentication.level_1.key_ids | arista.avd.natural_sort("id") %} +{% if auth_key.id not in both_key_ids %} {% if auth_key.rfc_5310 is arista.avd.defined(true) %} isis authentication key-id {{ auth_key.id }} algorithm {{ auth_key.algorithm }} rfc-5310 key {{ auth_key.key_type }} {{ auth_key.key }} level-1 {% else %} @@ -769,11 +751,7 @@ interface {{ port_channel_interface.name }} {% endif %} {% if port_channel_interface.isis_authentication.level_2.key_ids is arista.avd.defined %} {% for auth_key in port_channel_interface.isis_authentication.level_2.key_ids %} -{% if auth_key.id is arista.avd.defined - and auth_key.id not in both_key_ids - and auth_key.algorithm is arista.avd.defined - and auth_key.key_type is arista.avd.defined - and auth_key.key is arista.avd.defined %} +{% if auth_key.id not in both_key_ids %} {% if auth_key.rfc_5310 is arista.avd.defined(true) %} isis authentication key-id {{ auth_key.id }} algorithm {{ auth_key.algorithm }} rfc-5310 key {{ auth_key.key_type }} {{ auth_key.key }} level-2 {% else %} diff --git a/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/port_channel_interfaces.schema.yml b/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/port_channel_interfaces.schema.yml index 7c25b84d532..3710bf0e5b3 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/port_channel_interfaces.schema.yml +++ b/python-avd/pyavd/_eos_cli_config_gen/schema/schema_fragments/port_channel_interfaces.schema.yml @@ -631,6 +631,8 @@ keys: new_key: port_channel_interfaces[].isis_authentication.both.key or port_channel_interfaces[].isis_authentication.level_1.key or port_channel_interfaces[].isis_authentication.level_2.key isis_authentication: type: dict + description: This key should not be mixed with port_channel_interfaces[].isis_authentication_mode or ethernet_interfaces[].isis_authentication_key. + # TODO: AVD 6.0 Update the description $ref: "eos_cli_config_gen#/keys/router_isis/keys/authentication" traffic_policy: type: dict