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

`iptrunk_migration` updates related to BFD

When iptrunk_type == Leased, update is needed to the BFD config on the
__remaining_side__.
parent 883a79b1
No related branches found
No related tags found
1 merge request!148`iptrunk_migration` updates related to BFD
---
- 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 @@
delegate_to: localhost
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
ansible.builtin.include_tasks: set_netconf_connection.yaml
when: verb == "delete" or verb == "deactivate"
......
......@@ -35,11 +35,11 @@
- name: Calculate local side
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
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
ansible.builtin.set_fact:
......@@ -80,3 +80,11 @@
- name: Include the deployment tasks if specified
ansible.builtin.include_tasks: deploy_object.yaml
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 @@
ansible_host: "{{ local_side.iptrunk_side_node.router_site.site_ts_address }}"
ansible_port: "{{ local_side.iptrunk_side_node.router_ts_port }}"
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:
- "deactivate"
- "deploy"
- "delete"
- "update"
config_objects:
- "deactivate"
......@@ -13,6 +14,7 @@ config_objects:
- "trunk_interface"
- "isis_interface"
- "trunk_deprovision"
- "bfd_update"
bfd_min_interval: 3000
mtu_phy: 9212
......@@ -46,4 +48,6 @@ new_side:
remaining_side:
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 }}"
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