Skip to content

Commit

Permalink
Fixing template and porting-guide
Browse files Browse the repository at this point in the history
  • Loading branch information
Shivani-gslab committed Sep 4, 2024
1 parent 1fcf235 commit c657e72
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 22 deletions.
89 changes: 81 additions & 8 deletions ansible_collections/arista/avd/docs/porting-guides/5.x.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -510,32 +510,105 @@ With AVD 5.0.0, the default value for `type` in `ethernet_interfaces` and `port_

### Removal of `type` key dependency for rendering ethernet/port-channel interfaces configuration and documentation

#### IPv4 and IPv6 tables

In AVD 4.0.0, the tables for `IPv4` and `IPv6` in ethernet and port-channel interfaces were rendered only if `ethernet_interfaces[].type` or `port_channel_interfaces[].type` was set to `routed/l3dot1q`.

With AVD 5.0.0, the dependency on the 'type' key for rendering tables for IPv4 and IPv6 in ethernet and port-channel interfaces has been removed.

#### `vlan_id` configuration

In AVD 4.0.0, the configuration for `vlan_id` in ethernet interfaces and port-channel interfaces was rendered only if `ethernet_interfaces[].type` or `port_channel_interfaces[].type` was set to `l2dot1q`.

With AVD 5.0.0, the dependency on the 'type' key for rendering the configuration of `vlan_id` in ethernet and port-channel interfaces has been removed.
With AVD 5.0.0, the dependency on the `type` key for rendering the configuration of `vlan_id` in ethernet and port-channel interfaces has been removed.

```diff
-type: l2dot1q
vlan_id: 10
```

#### `switchport` configuration and documentation

In AVD 4.0.0, the configuration and documentation for `switchport` in ethernet and port-channel interfaces were renderend only if `ethernet_interfaces[].type` or `port_channel_interfaces[].type` was set to `switched` along with the keys `mode`, `vlans`, `native_vlan`, `native_vlan_tag`, `trunk_groups`, `phone`, `vlan_translations`, `trunk_private_vlan_secondary`, `pvlan_mapping`. The `no switchport` was renderend if `ethernet_interfaces[].type` or `port_channel_interfaces[].type` was set to `routed`.
In AVD 4.0.0, the configuration and documentation for `switchport` in ethernet and port-channel interfaces were renderend only if `ethernet_interfaces[].type` or `port_channel_interfaces[].type` was set to `switched` along with the keys `mode`, `vlans`, `native_vlan`, `native_vlan_tag`, `trunk_groups`, `phone`, `vlan_translations`, `trunk_private_vlan_secondary`, `pvlan_mapping`.
The `no switchport` command was renderend if `ethernet_interfaces[].type` or `port_channel_interfaces[].type` was set to `routed`.

With AVD 5.0.0, a new key for `switchport` has been introduced under ethernet and port-channel interfaces data-model, which generates the configuration and documentation for `switchport` independent of the `type` key.
The keys `mode`, `vlans`, `native_vlan`, `native_vlan_tag`, `trunk_groups`, `phone`, `vlan_translations`, `trunk_private_vlan_secondary`, `pvlan_mapping` are deprecated, to be removed in AVD 6.0.0.

```diff
-type: switched
-mode: trunk
-vlans: '1-5'
-native_vlan: 20
-native_vlan_tag: true
-trunk_groups: ['group1', 'group2']
-trunk_private_vlan_secondary: true
-pvlan_mapping: 20-30
- phone:
- vlan: 35
- trunk: tagged
-vlan_translations:
- - from: 10
- to: 20
- direction: in
- - from: 23
- to: 30
- direction: out
- - from: 1
- to: 5
- direction: both
+switchport:
+ mode: trunk
+ trunk:
+ allowed_vlan: 1-5
+ native_vlan: 20
+ native_vlan_tag: true
+ trunk_groups: ['group1', 'group2']
+ private_vlan_secondary: true
+ pvlan_mapping: 20-30
+ phone:
+ vlan: 35
+ trunk: tagged
+ vlan_translations:
+ direction_in:
+ - from: 10
+ to: 20
+ direction_out:
+ - from: 23
+ to: 30
+ direction_both:
+ - from: 1
+ to: 5
```

#### `encapsulation` configuration and documentation

In AVD 4.0.0, the configuration and documentation for `encapsulation` in ethernet and port-channel interfaces were renderend only if `ethernet_interfaces[].type` or `port_channel_interfaces[].type` was set to `l2dot1q/l3dot1q` along with the keys `encapsulation_dot1q_vlan` and `encapsulation_vlan`.

With AVD 5.0.0, a new key for `encapsulation_dot1q` has been introduced and the schema for `encapsulation_vlan` has been modified under ethernet and port-channel interfaces data-model, which generates the configuration and documentation for `encapsulation` independent of the `type` key.
The keys `encapsulation_dot1q_vlan`, `encapsulation_vlan.client.dot1q`, `encapsulation_vlan.client.unmatched`, `encapsulation_vlan.network.dot1q` and `encapsulation_vlan.network.client` are deprecated, to be removed in AVD 6.0.0.

```diff
-type: l3dot1q
-encapsulation_dot1q_vlan: 20
+encapsulation_dot1q:
+ vlan: 20
+ inner_vlan: 12
-encapsulation_vlan:
- dot1q:
- client:
- dot1q:
- outer: 10
- inner: 12
- network:
- dot1q:
- outer: 20
- inner: 22
+encapsulation_vlan:
+ client:
+ protocol: dot1q
+ outer_vlan: 10
+ inner_vlan: 12
+ network:
+ protocol: dot1q
+ outer_vlan: 20
+ inner_vlan: 22
```

### Removal of deprecated data models

The following data model keys have been removed from `eos_cli_config_gen` in v5.0.0.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,15 @@ interface {{ ethernet_interface.name }}
{% if encapsulation_cli is arista.avd.defined %}
{% if client_protocol in ['dot1q', 'dot1ad', 'untagged'] and ethernet_interface.encapsulation_vlan.network.protocol is arista.avd.defined and not network_flag %}
{% set network_protocol = ethernet_interface.encapsulation_vlan.network.protocol %}
{% if ethernet_interface.encapsulation_vlan.network.vlan is arista.avd.defined %}
{% set encapsulation_cli = encapsulation_cli ~ ' network ' ~ network_protocol ~ ' ' ~ ethernet_interface.encapsulation_vlan.network.vlan %}
{% elif ethernet_interface.encapsulation_vlan.network.outer_vlan is arista.avd.defined and ethernet_interface.encapsulation_vlan.network.inner_vlan is arista.avd.defined %}
{% if ethernet_interface.encapsulation_vlan.network.inner_protocol is arista.avd.defined %}
{% set encapsulation_cli = encapsulation_cli ~ ' network ' ~ network_protocol ~ ' outer ' ~ ethernet_interface.encapsulation_vlan.network.outer_vlan ~ ' inner ' ~ ethernet_interface.encapsulation_vlan.network.inner_protocol ~ ' ' ~ ethernet_interface.encapsulation_vlan.network.inner_vlan %}
{% else %}
{% set encapsulation_cli = encapsulation_cli ~ ' network ' ~ network_protocol ~ ' outer ' ~ ethernet_interface.encapsulation_vlan.network.outer_vlan ~ ' inner ' ~ ethernet_interface.encapsulation_vlan.network.inner_vlan %}
{% if network_protocol in ['dot1q', 'dot1ad'] %}
{% if ethernet_interface.encapsulation_vlan.network.vlan is arista.avd.defined %}
{% set encapsulation_cli = encapsulation_cli ~ ' network ' ~ network_protocol ~ ' ' ~ ethernet_interface.encapsulation_vlan.network.vlan %}
{% elif ethernet_interface.encapsulation_vlan.network.outer_vlan is arista.avd.defined and ethernet_interface.encapsulation_vlan.network.inner_vlan is arista.avd.defined %}
{% if ethernet_interface.encapsulation_vlan.network.inner_protocol is arista.avd.defined %}
{% set encapsulation_cli = encapsulation_cli ~ ' network ' ~ network_protocol ~ ' outer ' ~ ethernet_interface.encapsulation_vlan.network.outer_vlan ~ ' inner ' ~ ethernet_interface.encapsulation_vlan.network.inner_protocol ~ ' ' ~ ethernet_interface.encapsulation_vlan.network.inner_vlan %}
{% else %}
{% set encapsulation_cli = encapsulation_cli ~ ' network ' ~ network_protocol ~ ' outer ' ~ ethernet_interface.encapsulation_vlan.network.outer_vlan ~ ' inner ' ~ ethernet_interface.encapsulation_vlan.network.inner_vlan %}
{% endif %}
{% endif %}
{% elif network_protocol == 'untagged' and client_protocol == 'untagged' %}
{% set encapsulation_cli = encapsulation_cli ~ ' network untagged' %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,15 @@ interface {{ port_channel_interface.name }}
{% if encapsulation_cli is arista.avd.defined %}
{% if client_protocol in ['dot1q', 'dot1ad', 'untagged'] and port_channel_interface.encapsulation_vlan.network.protocol is arista.avd.defined and not network_flag %}
{% set network_protocol = port_channel_interface.encapsulation_vlan.network.protocol %}
{% if port_channel_interface.encapsulation_vlan.network.vlan is arista.avd.defined %}
{% set encapsulation_cli = encapsulation_cli ~ ' network ' ~ network_protocol ~ ' ' ~ port_channel_interface.encapsulation_vlan.network.vlan %}
{% elif port_channel_interface.encapsulation_vlan.network.outer_vlan is arista.avd.defined and port_channel_interface.encapsulation_vlan.network.inner_vlan is arista.avd.defined %}
{% if port_channel_interface.encapsulation_vlan.network.inner_protocol is arista.avd.defined %}
{% set encapsulation_cli = encapsulation_cli ~ ' network ' ~ network_protocol ~ ' outer ' ~ port_channel_interface.encapsulation_vlan.network.outer_vlan ~ ' inner ' ~ port_channel_interface.encapsulation_vlan.network.inner_protocol ~ ' ' ~ port_channel_interface.encapsulation_vlan.network.inner_vlan %}
{% else %}
{% set encapsulation_cli = encapsulation_cli ~ ' network ' ~ network_protocol ~ ' outer ' ~ port_channel_interface.encapsulation_vlan.network.outer_vlan ~ ' inner ' ~ port_channel_interface.encapsulation_vlan.network.inner_vlan %}
{% if network_protocol in ['dot1q', 'dot1ad'] %}
{% if port_channel_interface.encapsulation_vlan.network.vlan is arista.avd.defined %}
{% set encapsulation_cli = encapsulation_cli ~ ' network ' ~ network_protocol ~ ' ' ~ port_channel_interface.encapsulation_vlan.network.vlan %}
{% elif port_channel_interface.encapsulation_vlan.network.outer_vlan is arista.avd.defined and port_channel_interface.encapsulation_vlan.network.inner_vlan is arista.avd.defined %}
{% if port_channel_interface.encapsulation_vlan.network.inner_protocol is arista.avd.defined %}
{% set encapsulation_cli = encapsulation_cli ~ ' network ' ~ network_protocol ~ ' outer ' ~ port_channel_interface.encapsulation_vlan.network.outer_vlan ~ ' inner ' ~ port_channel_interface.encapsulation_vlan.network.inner_protocol ~ ' ' ~ port_channel_interface.encapsulation_vlan.network.inner_vlan %}
{% else %}
{% set encapsulation_cli = encapsulation_cli ~ ' network ' ~ network_protocol ~ ' outer ' ~ port_channel_interface.encapsulation_vlan.network.outer_vlan ~ ' inner ' ~ port_channel_interface.encapsulation_vlan.network.inner_vlan %}
{% endif %}
{% endif %}
{% elif network_protocol == 'untagged' and client_protocol == 'untagged' %}
{% set encapsulation_cli = encapsulation_cli ~ ' network untagged' %}
Expand Down

0 comments on commit c657e72

Please sign in to comment.