Skip to content
Snippets Groups Projects

Update playbook verbs for pre- and post-deployment checks in P to PE promotion

Merged Karel van Klink requested to merge feature/nat-889 into develop
All threads resolved!
@@ -60,20 +60,13 @@ def initial_input_form_generator(subscription_id: UUIDstr) -> FormGenerator:
return user_input.model_dump() | {"subscription": subscription}
@step("Evacuate the router by setting isis_overload")
def set_isis_overload(subscription: dict[str, Any], tt_number: str, process_id: UUIDstr) -> LSOState:
"""Evacuate the router by setting isis overload."""
extra_vars = {
"dry_run": False,
"subscription": subscription,
"commit_comment": f"GSO_PROCESS_ID: {process_id} - TT_NUMBER: {tt_number} - Set ISIS overload",
"verb": "set_isis_overload",
}
@step("Run pre-deployment checks")
def run_pre_checks(subscription: dict[str, Any]) -> LSOState:
"""Run pre-deployment checks."""
return {
"playbook_name": "gap_ansible/playbooks/promote_p_to_pe.yaml",
"inventory": {"all": {"hosts": {subscription["router"]["router_fqdn"]: None}}},
"extra_vars": extra_vars,
"extra_vars": {"subscription": subscription, "verb": "pre_checks"},
}
@@ -199,20 +192,13 @@ def deploy_routing_instances_real(subscription: dict[str, Any], tt_number: str,
}
@step("Remove ISIS overload")
def remove_isis_overload(subscription: dict[str, Any], tt_number: str, process_id: UUIDstr) -> LSOState:
"""Remove :term:`ISIS` overload."""
extra_vars = {
"dry_run": False,
"subscription": subscription,
"commit_comment": f"GSO_PROCESS_ID: {process_id} - TT_NUMBER: {tt_number} - Remove ISIS overload",
"verb": "remove_isis_overload",
}
@step("Run post-deployment checks")
def run_post_checks(subscription: dict[str, Any]) -> LSOState:
"""Run post-deployment checks."""
return {
"playbook_name": "gap_ansible/playbooks/promote_p_to_pe.yaml",
"inventory": {"all": {"hosts": {subscription["router"]["router_fqdn"]: None}}},
"extra_vars": extra_vars,
"extra_vars": {"subscription": subscription, "verb": "post_checks"},
}
@@ -271,7 +257,7 @@ def promote_p_to_pe() -> StepList:
begin
>> store_process_subscription(Target.MODIFY)
>> unsync
>> lso_interaction(set_isis_overload)
>> lso_interaction(run_pre_checks)
>> lso_interaction(deploy_pe_base_config_dry)
>> lso_interaction(deploy_pe_base_config_real)
>> prompt_insert_in_earl
@@ -294,7 +280,7 @@ 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(remove_isis_overload)
>> lso_interaction(run_post_checks)
>> update_subscription_model
>> resync
>> done
Loading