Skip to content
Snippets Groups Projects

`promote_p_to_pe`: PE static routes as a separate step

Merged Aleksandr Kurbatov requested to merge feature/promote-p-to-pe-static-routes into develop
2 files
+ 40
2
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -246,6 +246,42 @@ def delete_default_routes_real(subscription: dict[str, Any], tt_number: str, pro
}
@step("[DRY RUN] Add PE static routes")
def add_pe_static_routes_dry(subscription: dict[str, Any], tt_number: str, process_id: UUIDstr) -> LSOState:
"""Perform a dry run of adding the PE static routes."""
extra_vars = {
"dry_run": True,
"subscription": subscription,
"commit_comment": f"GSO_PROCESS_ID: {process_id} - TT_NUMBER: {tt_number} - "
f"Delete static default routes (part of P base-config)",
"verb": "add_pe_static_routes",
}
return {
"playbook_name": "gap_ansible/playbooks/promote_p_to_pe.yaml",
"inventory": {"all": {"hosts": {subscription["router"]["router_fqdn"]: None}}},
"extra_vars": extra_vars,
}
@step("[FOR REAL] Add PE static routes")
def add_pe_static_routes_real(subscription: dict[str, Any], tt_number: str, process_id: UUIDstr) -> LSOState:
"""Perform a real run of adding the PE static routes."""
extra_vars = {
"dry_run": False,
"subscription": subscription,
"commit_comment": f"GSO_PROCESS_ID: {process_id} - TT_NUMBER: {tt_number} - "
f"Delete static default routes (part of P base-config)",
"verb": "add_pe_static_routes",
}
return {
"playbook_name": "gap_ansible/playbooks/promote_p_to_pe.yaml",
"inventory": {"all": {"hosts": {subscription["router"]["router_fqdn"]: None}}},
"extra_vars": extra_vars,
}
@workflow(
"Promote P router to PE router",
initial_input_form=wrap_modify_initial_input_form(initial_input_form_generator),
@@ -280,6 +316,8 @@ def promote_p_to_pe() -> StepList:
>> lso_interaction(add_pe_to_all_p_real)
>> lso_interaction(delete_default_routes_dry)
>> lso_interaction(delete_default_routes_real)
>> lso_interaction(add_pe_static_routes_dry)
>> lso_interaction(add_pe_static_routes_real)
>> lso_interaction(run_post_checks)
>> update_subscription_model
>> resync
Loading