Skip to content
Snippets Groups Projects
Commit f8734b45 authored by Aleksandr Kurbatov's avatar Aleksandr Kurbatov
Browse files

Merge branch 'bugfix/nat-619-bfd' into 'develop'

`iptrunk_migration` updates related to BFD

See merge request !148
parents 883a79b1 10c0f093
No related branches found
No related tags found
1 merge request!148`iptrunk_migration` updates related to BFD
Pipeline #87434 passed
- name: Juniper BFD check
when: local_side.iptrunk_side_node.vendor == "juniper"
block:
- name: Get status of BFD for neighbor "{{ new_node.router.router_lo_ipv4_address }}"
junipernetworks.junos.junos_command:
commands:
- show bfd session address "{{ new_node.router.router_lo_ipv4_address }}"
register: response
- name: Show status of BFD neigbor
ansible.builtin.debug:
msg: "{{ response.stdout_lines[0] }}"
- name: Nokia BFD check
when: local_side.iptrunk_side_node.vendor == "nokia"
block:
- name: Get status of BFD for neighbor "{{ new_node.router.router_lo_ipv4_address }}"
ansible.netcommon.netconf_rpc:
rpc: action
xmlns: "urn:ietf:params:xml:ns:yang:1"
content: |
<global-operations xmlns="urn:nokia.com:sros:ns:yang:sr:oper-global">
<md-cli-raw-command>
<md-cli-input-line>show lag {{ local_side.iptrunk_side_ae_iface | lower }} bfd</md-cli-input-line>
</md-cli-raw-command>
</global-operations>
display: json
register: out
- name: Show BFD status
ansible.builtin.debug:
msg: "{{out.output['rpc-reply']['nokiaoper:results']['nokiaoper:md-cli-output-block'].split('\n')}}"
...@@ -81,6 +81,10 @@ ...@@ -81,6 +81,10 @@
ansible.builtin.include_tasks: check_trunk_interface.yaml ansible.builtin.include_tasks: check_trunk_interface.yaml
when: check == "ping" when: check == "ping"
- name: Check BFD
ansible.builtin.include_tasks: check_bfd.yaml
when: check == "bfd"
- name: Set the optical checks results directory name - name: Set the optical checks results directory name
when: check == "optical_pre" or check == "optical_post" when: check == "optical_pre" or check == "optical_post"
ansible.builtin.set_fact: ansible.builtin.set_fact:
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
# vars file for iptrunks # vars file for iptrunks
# #
checks: checks:
- bfd
- isis - isis
- ping - ping
- lacp - lacp
......
---
- name: Update Trunk interface BFD on "{{ inventory_hostname }}" [CHECK ONLY][JUNIPER]
junipernetworks.junos.junos_config:
update: 'replace'
src: "/var/tmp/ansible_run_{{ opid }}/{{ config_object }}.conf"
src_format: set
check_commit: true
diff: true
when: >
verb == "update" and
remaining_side.vendor == "juniper" and
dry_run | ansible.builtin.bool
- name: Update Trunk interface BFD on "{{ inventory_hostname }}" [AND COMMIT][JUNIPER]
junipernetworks.junos.junos_config:
update: 'replace'
src: "/var/tmp/ansible_run_{{ opid }}/{{ config_object }}.conf"
src_format: set
comment: "{{ commit_comment }}"
diff: true
when: >
verb == "update" and
remaining_side.vendor == "juniper" and
not (dry_run | ansible.builtin.bool)
...@@ -40,6 +40,16 @@ ...@@ -40,6 +40,16 @@
delegate_to: localhost delegate_to: localhost
when: (verb == "deploy") and inventory_hostname == new_node.router.router_fqdn when: (verb == "deploy") and inventory_hostname == new_node.router.router_fqdn
- name: Print template for the remaining node in "/var/tmp/ansible_run_{{ opid }}/{{ config_object }}.conf"
ansible.builtin.template:
src: "{{ remaining_side.vendor }}/{{ config_object }}.j2"
dest: "/var/tmp/ansible_run_{{ opid }}/{{ config_object }}.conf"
lstrip_blocks: true
trim_blocks: true
mode: '0755'
delegate_to: localhost
when: (verb == "update") and inventory_hostname == remaining_side.name
- name: Set netconf connection for trunk nodes - name: Set netconf connection for trunk nodes
ansible.builtin.include_tasks: set_netconf_connection.yaml ansible.builtin.include_tasks: set_netconf_connection.yaml
when: verb == "delete" or verb == "deactivate" when: verb == "delete" or verb == "deactivate"
......
...@@ -35,11 +35,11 @@ ...@@ -35,11 +35,11 @@
- name: Calculate local side - name: Calculate local side
ansible.builtin.include_tasks: calculate_local_side.yaml ansible.builtin.include_tasks: calculate_local_side.yaml
when: (verb == "delete" or verb == "deactivate") and inventory_hostname != new_node.router.router_fqdn when: (verb in ["delete", "deactivate", "update"]) and inventory_hostname != new_node.router.router_fqdn
- name: Set netconf connection for trunk nodes - name: Set netconf connection for trunk nodes
ansible.builtin.include_tasks: set_netconf_connection.yaml ansible.builtin.include_tasks: set_netconf_connection.yaml
when: (verb == "delete" or verb == "deactivate") and inventory_hostname != new_node.router.router_fqdn when: (verb in ["delete", "deactivate", "update"]) and inventory_hostname != new_node.router.router_fqdn
- name: Set ansible_host connection for new side - name: Set ansible_host connection for new side
ansible.builtin.set_fact: ansible.builtin.set_fact:
...@@ -80,3 +80,11 @@ ...@@ -80,3 +80,11 @@
- name: Include the deployment tasks if specified - name: Include the deployment tasks if specified
ansible.builtin.include_tasks: deploy_object.yaml ansible.builtin.include_tasks: deploy_object.yaml
when: verb == "deploy" and inventory_hostname == new_node.router.router_fqdn 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
- 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
...@@ -3,4 +3,4 @@ ...@@ -3,4 +3,4 @@
ansible_host: "{{ local_side.iptrunk_side_node.router_site.site_ts_address }}" ansible_host: "{{ local_side.iptrunk_side_node.router_site.site_ts_address }}"
ansible_port: "{{ local_side.iptrunk_side_node.router_ts_port }}" ansible_port: "{{ local_side.iptrunk_side_node.router_ts_port }}"
when: when:
( local_side.iptrunk_side_node.router_access_via_ts | ansible.builtin.bool ) is true local_side.iptrunk_side_node.router_access_via_ts | ansible.builtin.bool
set interfaces {{ remaining_side.ae_name }} aggregated-ether-options bfd-liveness-detection neighbor {{ new_node.router.router_lo_ipv4_address }}
...@@ -6,6 +6,7 @@ verbs: ...@@ -6,6 +6,7 @@ verbs:
- "deactivate" - "deactivate"
- "deploy" - "deploy"
- "delete" - "delete"
- "update"
config_objects: config_objects:
- "deactivate" - "deactivate"
...@@ -13,6 +14,7 @@ config_objects: ...@@ -13,6 +14,7 @@ config_objects:
- "trunk_interface" - "trunk_interface"
- "isis_interface" - "isis_interface"
- "trunk_deprovision" - "trunk_deprovision"
- "bfd_update"
bfd_min_interval: 3000 bfd_min_interval: 3000
mtu_phy: 9212 mtu_phy: 9212
...@@ -46,4 +48,6 @@ new_side: ...@@ -46,4 +48,6 @@ new_side:
remaining_side: remaining_side:
name: "{{ wfo_trunk.iptrunk.iptrunk_sides[1 - (replace_index | int)].iptrunk_side_node.router_fqdn }}" name: "{{ wfo_trunk.iptrunk.iptrunk_sides[1 - (replace_index | int)].iptrunk_side_node.router_fqdn }}"
vendor: "{{ wfo_trunk.iptrunk.iptrunk_sides[1 - (replace_index | int)].iptrunk_side_node.vendor }}"
loopback: "{{ wfo_trunk.iptrunk.iptrunk_sides[1 - (replace_index | int)].iptrunk_side_node.router_lo_ipv4_address }}" loopback: "{{ wfo_trunk.iptrunk.iptrunk_sides[1 - (replace_index | int)].iptrunk_side_node.router_lo_ipv4_address }}"
ae_name: "{{ wfo_trunk.iptrunk.iptrunk_sides[1 - (replace_index | int)].iptrunk_side_ae_iface }}"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment