Skip to content
Snippets Groups Projects

Updated `promote_p_to_pe`

Merged Aleksandr Kurbatov requested to merge fix/promote-p-to-pe into develop
All threads resolved!
1 file
+ 30
24
Compare changes
  • Side-by-side
  • Inline
@@ -158,7 +158,7 @@ def create_kentik_device(subscription: Router) -> State:
@@ -158,7 +158,7 @@ def create_kentik_device(subscription: Router) -> State:
return {"kentik_device": kentik_device}
return {"kentik_device": kentik_device}
@step("[DRY RUN] Update SDP mesh")
@step("[DRY RUN] Include new PE into SDP mesh on other Nokia PEs")
def update_sdp_mesh_dry(subscription: dict[str, Any], callback_route: str, tt_number: str, process_id: UUIDstr) -> None:
def update_sdp_mesh_dry(subscription: dict[str, Any], callback_route: str, tt_number: str, process_id: UUIDstr) -> None:
"""Perform a dry run for updating the SDP mesh with the new router."""
"""Perform a dry run for updating the SDP mesh with the new router."""
extra_vars = {
extra_vars = {
@@ -167,20 +167,23 @@ def update_sdp_mesh_dry(subscription: dict[str, Any], callback_route: str, tt_nu
@@ -167,20 +167,23 @@ def update_sdp_mesh_dry(subscription: dict[str, Any], callback_route: str, tt_nu
"commit_comment": f"GSO_PROCESS_ID: {process_id} - TT_NUMBER: {tt_number} - "
"commit_comment": f"GSO_PROCESS_ID: {process_id} - TT_NUMBER: {tt_number} - "
f"Update the SDP mesh for L2circuits(epipes) config on PE NOKIA routers",
f"Update the SDP mesh for L2circuits(epipes) config on PE NOKIA routers",
"verb": "update_sdp_mesh",
"verb": "update_sdp_mesh",
"pe_router_list": generate_inventory_for_active_routers(router_role=RouterRole.PE, router_vendor=Vendor.NOKIA)[
"pe_router_list": {
"all"
subscription["router"]["router_fqdn"]: {
]["hosts"],
"lo4": str(subscription["router"]["router_lo_ipv4_address"]),
 
"lo6": str(subscription["router"]["router_lo_ipv6_address"]),
 
}
 
},
}
}
lso_client.execute_playbook(
lso_client.execute_playbook(
playbook_name="update_pe_sdp_mesh.yaml",
playbook_name="update_pe_sdp_mesh.yaml",
callback_route=callback_route,
callback_route=callback_route,
inventory=generate_inventory_for_active_routers(RouterRole.PE),
inventory=generate_inventory_for_active_routers(router_role=RouterRole.PE, router_vendor=Vendor.NOKIA),
extra_vars=extra_vars,
extra_vars=extra_vars,
)
)
@step("[FOR REAL] Update SDP mesh")
@step("[FOR REAL] Include new PE into SDP mesh on other Nokia PEs")
def update_sdp_mesh_real(
def update_sdp_mesh_real(
subscription: dict[str, Any], callback_route: str, tt_number: str, process_id: UUIDstr
subscription: dict[str, Any], callback_route: str, tt_number: str, process_id: UUIDstr
) -> None:
) -> None:
@@ -191,29 +194,32 @@ def update_sdp_mesh_real(
@@ -191,29 +194,32 @@ def update_sdp_mesh_real(
"commit_comment": f"GSO_PROCESS_ID: {process_id} - TT_NUMBER: {tt_number} - "
"commit_comment": f"GSO_PROCESS_ID: {process_id} - TT_NUMBER: {tt_number} - "
f"Update the SDP mesh for l2circuits(epipes) config on PE NOKIA routers",
f"Update the SDP mesh for l2circuits(epipes) config on PE NOKIA routers",
"verb": "update_sdp_mesh",
"verb": "update_sdp_mesh",
"pe_router_list": generate_inventory_for_active_routers(router_role=RouterRole.PE, router_vendor=Vendor.NOKIA)[
"pe_router_list": {
"all"
subscription["router"]["router_fqdn"]: {
]["hosts"],
"lo4": str(subscription["router"]["router_lo_ipv4_address"]),
 
"lo6": str(subscription["router"]["router_lo_ipv6_address"]),
 
}
 
},
}
}
lso_client.execute_playbook(
lso_client.execute_playbook(
playbook_name="update_pe_sdp_mesh.yaml",
playbook_name="update_pe_sdp_mesh.yaml",
callback_route=callback_route,
callback_route=callback_route,
inventory=generate_inventory_for_active_routers(RouterRole.PE),
inventory=generate_inventory_for_active_routers(router_role=RouterRole.PE, router_vendor=Vendor.NOKIA),
extra_vars=extra_vars,
extra_vars=extra_vars,
)
)
@step("[DRY RUN] Remove P from P")
@step("[DRY RUN] Remove P from all PEs")
def remove_p_from_pe_dry(
def remove_p_from_pe_dry(
subscription: dict[str, Any], callback_route: str, tt_number: str, process_id: UUIDstr
subscription: dict[str, Any], callback_route: str, tt_number: str, process_id: UUIDstr
) -> None:
) -> None:
"""Perform a dry run of removing the P routers from the PE router."""
"""Perform a dry run of removing the P router from all the PE routers."""
extra_vars = {
extra_vars = {
"dry_run": True,
"dry_run": True,
"subscription": subscription,
"subscription": subscription,
"commit_comment": f"GSO_PROCESS_ID: {process_id} - TT_NUMBER: {tt_number} - "
"commit_comment": f"GSO_PROCESS_ID: {process_id} - TT_NUMBER: {tt_number} - "
f"Remove P only roter neighbour {subscription["router"]["router_fqdn"]} from P only group",
f"Remove P-only router neighbour {subscription["router"]["router_fqdn"]} from PE routers P-only group",
"verb": "remove_p_from_pe",
"verb": "remove_p_from_pe",
}
}
@@ -225,16 +231,16 @@ def remove_p_from_pe_dry(
@@ -225,16 +231,16 @@ def remove_p_from_pe_dry(
)
)
@step("[FOR REAL] Remove P from PE")
@step("[FOR REAL] Remove P from all PEs")
def remove_p_from_pe_real(
def remove_p_from_pe_real(
subscription: dict[str, Any], callback_route: str, tt_number: str, process_id: UUIDstr
subscription: dict[str, Any], callback_route: str, tt_number: str, process_id: UUIDstr
) -> None:
) -> None:
"""Remove the P routers from the PE router."""
"""Remove the P router from all the PE routers."""
extra_vars = {
extra_vars = {
"dry_run": False,
"dry_run": False,
"subscription": subscription,
"subscription": subscription,
"commit_comment": f"GSO_PROCESS_ID: {process_id} - TT_NUMBER: {tt_number} - "
"commit_comment": f"GSO_PROCESS_ID: {process_id} - TT_NUMBER: {tt_number} - "
f"Remove P only roter neighbour {subscription["router"]["router_fqdn"]} from P only group",
f"Remove P-only router neighbour {subscription["router"]["router_fqdn"]} from PE routers P-only group",
"verb": "remove_p_from_pe",
"verb": "remove_p_from_pe",
}
}
@@ -299,7 +305,7 @@ def add_pe_to_pe_mesh_dry(
@@ -299,7 +305,7 @@ def add_pe_to_pe_mesh_dry(
"dry_run": True,
"dry_run": True,
"subscription": subscription,
"subscription": subscription,
"commit_comment": f"GSO_PROCESS_ID: {process_id} - TT_NUMBER: {tt_number} - "
"commit_comment": f"GSO_PROCESS_ID: {process_id} - TT_NUMBER: {tt_number} - "
f"Add promoted router to all PE routers in iGEANT/iGEANT.",
f"Add promoted router to all PE routers in iGEANT/iGEANT6.",
"verb": "add_pe_to_pe_mesh",
"verb": "add_pe_to_pe_mesh",
}
}
@@ -320,7 +326,7 @@ def add_pe_to_pe_mesh_real(
@@ -320,7 +326,7 @@ def add_pe_to_pe_mesh_real(
"dry_run": False,
"dry_run": False,
"subscription": subscription,
"subscription": subscription,
"commit_comment": f"GSO_PROCESS_ID: {process_id} - TT_NUMBER: {tt_number} - "
"commit_comment": f"GSO_PROCESS_ID: {process_id} - TT_NUMBER: {tt_number} - "
f"Add promoted router to all PE routers in iGEANT/iGEANT.",
f"Add promoted router to all PE routers in iGEANT/iGEANT6.",
"verb": "add_pe_to_pe_mesh",
"verb": "add_pe_to_pe_mesh",
}
}
@@ -482,7 +488,7 @@ def add_pe_to_all_p_dry(subscription: dict[str, Any], callback_route: str, tt_nu
@@ -482,7 +488,7 @@ def add_pe_to_all_p_dry(subscription: dict[str, Any], callback_route: str, tt_nu
"subscription": subscription,
"subscription": subscription,
"commit_comment": f"GSO_PROCESS_ID: {process_id} - TT_NUMBER: {tt_number} - "
"commit_comment": f"GSO_PROCESS_ID: {process_id} - TT_NUMBER: {tt_number} - "
f"Add promoted router to all PE routers in iGEANT/iGEANT6",
f"Add promoted router to all PE routers in iGEANT/iGEANT6",
"verb": "add_pe_to_p",
"verb": "add_pe_to_all_p",
}
}
lso_client.execute_playbook(
lso_client.execute_playbook(
@@ -503,7 +509,7 @@ def add_pe_to_all_p_real(
@@ -503,7 +509,7 @@ def add_pe_to_all_p_real(
"subscription": subscription,
"subscription": subscription,
"commit_comment": f"GSO_PROCESS_ID: {process_id} - TT_NUMBER: {tt_number} - "
"commit_comment": f"GSO_PROCESS_ID: {process_id} - TT_NUMBER: {tt_number} - "
f"Add promoted router to all PE routers in iGEANT/iGEANT6",
f"Add promoted router to all PE routers in iGEANT/iGEANT6",
"verb": "add_pe_to_p",
"verb": "add_pe_to_all_p",
}
}
lso_client.execute_playbook(
lso_client.execute_playbook(
@@ -572,8 +578,6 @@ def promote_p_to_pe() -> StepList:
@@ -572,8 +578,6 @@ def promote_p_to_pe() -> StepList:
>> lso_interaction(deploy_pe_base_config_real)
>> lso_interaction(deploy_pe_base_config_real)
>> prompt_insert_in_earl
>> prompt_insert_in_earl
>> create_kentik_device
>> create_kentik_device
>> lso_interaction(update_sdp_mesh_dry)
>> lso_interaction(update_sdp_mesh_real)
>> lso_interaction(remove_p_from_pe_dry)
>> lso_interaction(remove_p_from_pe_dry)
>> lso_interaction(remove_p_from_pe_real)
>> lso_interaction(remove_p_from_pe_real)
>> lso_interaction(add_pe_mesh_to_pe_dry)
>> lso_interaction(add_pe_mesh_to_pe_dry)
@@ -584,14 +588,16 @@ def promote_p_to_pe() -> StepList:
@@ -584,14 +588,16 @@ def promote_p_to_pe() -> StepList:
>> lso_interaction(deploy_routing_instances_dry)
>> lso_interaction(deploy_routing_instances_dry)
>> lso_interaction(deploy_routing_instances_real)
>> lso_interaction(deploy_routing_instances_real)
>> lso_interaction(check_l3_services)
>> lso_interaction(check_l3_services)
>> lso_interaction(remove_isis_overload)
>> lso_interaction(update_sdp_mesh_dry)
>> update_subscription_model
>> lso_interaction(update_sdp_mesh_real)
>> lso_interaction(add_all_p_to_pe_dry)
>> lso_interaction(add_all_p_to_pe_dry)
>> lso_interaction(add_all_p_to_pe_real)
>> lso_interaction(add_all_p_to_pe_real)
>> lso_interaction(add_pe_to_all_p_dry)
>> lso_interaction(add_pe_to_all_p_dry)
>> lso_interaction(add_pe_to_all_p_real)
>> lso_interaction(add_pe_to_all_p_real)
>> lso_interaction(delete_default_routes_dry)
>> lso_interaction(delete_default_routes_dry)
>> lso_interaction(delete_default_routes_real)
>> lso_interaction(delete_default_routes_real)
 
>> lso_interaction(remove_isis_overload)
 
>> update_subscription_model
>> resync
>> resync
>> done
>> done
)
)
Loading