diff --git a/geant/gap_ansible/roles/iptrunk_migration/templates/nokia/trunk_deprovision.j2 b/geant/gap_ansible/roles/iptrunk_migration/templates/nokia/trunk_deprovision.j2 new file mode 100644 index 0000000000000000000000000000000000000000..0bde57add0401f80536d02221386a4e57ca6c6be --- /dev/null +++ b/geant/gap_ansible/roles/iptrunk_migration/templates/nokia/trunk_deprovision.j2 @@ -0,0 +1,66 @@ +<config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:alu="urn:ietf:params:xml:ns:netconf:base:1.0"> + <configure xmlns="urn:nokia.com:sros:ns:yang:sr:conf"> + +{##} +{% for trunk in trunks %} + {% if inventory_hostname == trunk.config.nodeA.name %} + {% set local= trunk.config.nodeA %} + {% set remote= trunk.config.nodeB %} + {% set common= trunk.config.common %} + {% endif %} + {% if inventory_hostname == trunk.config.nodeB.name %} + {% set local= trunk.config.nodeB %} + {% set remote= trunk.config.nodeA %} + {% set common= trunk.config.common %} + {% endif %} + + {% if local is defined %} + {##} + {# I need to sort the source and the destination alfabetically #} + {% set trunk_direction_name = [ local.name.split(".")[1] | upper, remote.name.split(".")[1] | upper ] %} + {% set trunk_direction_name_sorted = trunk_direction_name|sort %} +{##} + +{% for member in local.members %} + <port xmlns="urn:nokia.com:sros:ns:yang:sr:conf" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nokia-attr="urn:nokia.com:sros:ns:yang:sr:attributes" alu:operation="delete"> + <port-id>{{ member.interface_name }}</port-id> + </port> +{% endfor %} + + <lag xmlns="urn:nokia.com:sros:ns:yang:sr:conf" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nokia-attr="urn:nokia.com:sros:ns:yang:sr:attributes" alu:operation="delete"> + <lag-name>{{ local.ae_name }}</lag-name> + </lag> + + <router xmlns="urn:nokia.com:sros:ns:yang:sr:conf" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nokia-attr="urn:nokia.com:sros:ns:yang:sr:attributes"> + <router-name>Base</router-name> + <interface alu:operation="delete"> + <interface-name>{{ local.ae_name }}.0</interface-name> + </interface> + <isis xmlns="urn:nokia.com:sros:ns:yang:sr:conf" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nokia-attr="urn:nokia.com:sros:ns:yang:sr:attributes"> + <isis-instance>0</isis-instance> + <interface xmlns="urn:nokia.com:sros:ns:yang:sr:conf" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nokia-attr="urn:nokia.com:sros:ns:yang:sr:attributes" alu:operation="delete"> + <interface-name>{{ local.ae_name }}.0</interface-name> + </interface> + </isis> + <mpls xmlns="urn:nokia.com:sros:ns:yang:sr:conf" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nokia-attr="urn:nokia.com:sros:ns:yang:sr:attributes"> + <interface alu:operation="delete"> + <interface-name>{{ local.ae_name | lower }}.0</interface-name> + </interface> + </mpls> + <pim xmlns="urn:nokia.com:sros:ns:yang:sr:conf" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nokia-attr="urn:nokia.com:sros:ns:yang:sr:attributes"> + <interface alu:operation="delete"> + <interface-name>{{ local.ae_name | lower }}.0</interface-name> + </interface> + </pim> + <rsvp xmlns="urn:nokia.com:sros:ns:yang:sr:conf" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nokia-attr="urn:nokia.com:sros:ns:yang:sr:attributes"> + <interface alu:operation="delete"> + <interface-name>{{ local.ae_name | lower }}.0</interface-name> + </interface> + </rsvp> + </router> + + {% endif %} +{% endfor %} + + </configure> +</config>