diff --git a/geant/gap_ansible/roles/iptrunk_migration/tasks/calculate_ips.yaml b/geant/gap_ansible/roles/iptrunk_migration/tasks/calculate_ips.yaml index f59f76fa10f9af60611b7fc096489f74772953e0..0179532610dcd1ff43772897454e00195d0d254f 100644 --- a/geant/gap_ansible/roles/iptrunk_migration/tasks/calculate_ips.yaml +++ b/geant/gap_ansible/roles/iptrunk_migration/tasks/calculate_ips.yaml @@ -2,6 +2,7 @@ ansible.builtin.set_fact: new_ipv4_address: "{{ side_a_ipv4_address }}" new_ipv6_address: "{{ side_a_ipv6_address }}" + remain_ipv4_address: "{{ side_b_ipv4_address }}" when: (replace_index|int) == 0 @@ -9,5 +10,6 @@ ansible.builtin.set_fact: new_ipv4_address: "{{ side_b_ipv4_address }}" new_ipv6_address: "{{ side_b_ipv6_address }}" + remain_ipv4_address: "{{ side_a_ipv4_address }}" when: (replace_index|int) == 1 diff --git a/geant/gap_ansible/roles/iptrunk_migration/tasks/main.yml b/geant/gap_ansible/roles/iptrunk_migration/tasks/main.yml index 6b475754590499acbc2d2c17a21779c3e4fd8c66..fcb50939c1a37774286e7a4fb97361084f2784fd 100644 --- a/geant/gap_ansible/roles/iptrunk_migration/tasks/main.yml +++ b/geant/gap_ansible/roles/iptrunk_migration/tasks/main.yml @@ -28,6 +28,9 @@ ansible.builtin.debug: msg: "{{ new_node.router.router_fqdn }}" +- name: Include set trunk version tasks + ansible.builtin.include_tasks: set_trunk_version.yaml + - name: Include configure storage tasks ansible.builtin.include_tasks: configure_storage.yaml @@ -80,9 +83,13 @@ when: verb == "deploy" and inventory_hostname == new_node.router.router_fqdn - name: Compile update for the remaining node (BFD update) - ansible.builtin.include_tasks: compile_template.yaml when: verb == "update" and inventory_hostname == remaining_side.name + block: + - name: Include calculate_ips + ansible.builtin.include_tasks: calculate_ips.yaml -- name: Include update for the remaining node (BFD update) - ansible.builtin.include_tasks: bfd_update.yaml - when: verb == "update" and inventory_hostname == remaining_side.name + - name: Include compiling template + ansible.builtin.include_tasks: compile_template.yaml + + - name: Include BFD update + ansible.builtin.include_tasks: bfd_update.yaml diff --git a/geant/gap_ansible/roles/iptrunk_migration/tasks/set_trunk_version.yaml b/geant/gap_ansible/roles/iptrunk_migration/tasks/set_trunk_version.yaml new file mode 120000 index 0000000000000000000000000000000000000000..6616a24720dcdcefdb215e75b95655375ba10ccf --- /dev/null +++ b/geant/gap_ansible/roles/iptrunk_migration/tasks/set_trunk_version.yaml @@ -0,0 +1 @@ +../../../tasks/set_trunk_version.yaml \ No newline at end of file diff --git a/geant/gap_ansible/roles/iptrunk_migration/templates/nokia/bfd_update.j2 b/geant/gap_ansible/roles/iptrunk_migration/templates/nokia/bfd_update.j2 index 7bbc7131807aee25f0c11e483f5ae5be4a1bfc45..0d5e0c309a2d2d102cbce0f8ccb339816d719121 100644 --- a/geant/gap_ansible/roles/iptrunk_migration/templates/nokia/bfd_update.j2 +++ b/geant/gap_ansible/roles/iptrunk_migration/templates/nokia/bfd_update.j2 @@ -5,7 +5,11 @@ <lag-name>{{ remaining_side.ae_name | lower }}</lag-name> <bfd-liveness> <ipv4> + {% if trunk_version | float < 2.0 %} <remote-ip-address alu:operation="replace">{{ new_node.router.router_lo_ipv4_address }}</remote-ip-address> + {% else %} + <remote-ip-address alu:operation="replace">{{ (new_ipv4_address | split('/'))[0] }}</remote-ip-address> + {% endif %} </ipv4> </bfd-liveness> </lag> diff --git a/geant/gap_ansible/roles/iptrunk_migration/templates/nokia/trunk_interface.j2 b/geant/gap_ansible/roles/iptrunk_migration/templates/nokia/trunk_interface.j2 index 3168ab25bba47315c9de27fe30ab110c5cc24f1f..e49c7b32a693b0c0605ad1bf0cc05bd66f5566ef 100644 --- a/geant/gap_ansible/roles/iptrunk_migration/templates/nokia/trunk_interface.j2 +++ b/geant/gap_ansible/roles/iptrunk_migration/templates/nokia/trunk_interface.j2 @@ -25,6 +25,13 @@ </tx-tlvs> </dest-mac> </lldp> + {% if trunk_version | float >= 2.0 %} + <network> + <egress> + <queue-policy>GEANT_BASIC</queue-policy> + </egress> + </network> + {% endif %} </ethernet> </port> {% endfor %} @@ -55,8 +62,14 @@ <multiplier>3</multiplier> <receive-interval>{{ bfd_min_interval }}</receive-interval> <transmit-interval>{{ bfd_min_interval }}</transmit-interval> + {% if trunk_version | float < 2.0 %} <local-ip-address>{{ new_node.router.router_lo_ipv4_address }}</local-ip-address> <remote-ip-address>{{ remaining_side['loopback'] }}</remote-ip-address> + {% else %} + <bfd-on-distributing-only>true</bfd-on-distributing-only> + <local-ip-address>{{ (new_ipv4_address | split('/'))[0] }}</local-ip-address> + <remote-ip-address>{{ (remain_ipv4_address | split('/'))[0] }}</remote-ip-address> + {% endif %} </ipv4> </bfd-liveness> {% endif %} @@ -78,14 +91,14 @@ </ttl-expired> </icmp> <primary> - <address>{{(new_ipv4_address| split('/'))[0]}}</address> - <prefix-length>{{(new_ipv4_address| split('/'))[1]}}</prefix-length> + <address>{{ (new_ipv4_address| split('/'))[0] }}</address> + <prefix-length>{{ (new_ipv4_address| split('/'))[1] }}</prefix-length> </primary> </ipv4> <ipv6> <address> - <ipv6-address>{{(new_ipv6_address| split('/'))[0]}}</ipv6-address> - <prefix-length>{{(new_ipv6_address| split('/'))[1]}}</prefix-length> + <ipv6-address>{{ (new_ipv6_address| split('/'))[0] }}</ipv6-address> + <prefix-length>{{ (new_ipv6_address| split('/'))[1] }}</prefix-length> </address> </ipv6> <qos>