Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
GÉANT Service Orchestrator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GÉANT Orchestration and Automation Team
GAP
GÉANT Service Orchestrator
Commits
aad42eca
Commit
aad42eca
authored
11 months ago
by
Karel van Klink
Committed by
Neda Moeini
8 months ago
Browse files
Options
Downloads
Patches
Plain Diff
re-order steps in router validation workflow
parent
a6c0fc1c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!139
Feature/add validation workflows
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gso/workflows/router/validate_router.py
+14
-14
14 additions, 14 deletions
gso/workflows/router/validate_router.py
with
14 additions
and
14 deletions
gso/workflows/router/validate_router.py
+
14
−
14
View file @
aad42eca
...
...
@@ -14,6 +14,18 @@ from gso.services import infoblox
from
gso.services.lso_client
import
execute_playbook
,
lso_interaction
@step
(
"
Verify IPAM resources for loopback interface
"
)
def
verify_ipam_loopback
(
subscription
:
Router
)
->
None
:
"""
Validate the :term:`IPAM` resources for the loopback interface.
Raises an :class:`orchestrator.utils.errors.ProcessFailureError` if :term:`IPAM` is configured incorrectly.
"""
host_record
=
infoblox
.
find_host_by_fqdn
(
f
"
lo0.
{
subscription
.
router
.
router_fqdn
}
"
)
if
not
host_record
or
str
(
subscription
.
subscription_id
)
not
in
host_record
.
comment
:
msg
=
"
Loopback record is incorrectly configured in IPAM, please investigate this manually!
"
raise
ProcessFailureError
(
msg
)
@step
(
"
Validate router configuration
"
)
def
validate_router_config
(
subscription
:
Router
,
callback_route
:
str
)
->
None
:
"""
Run an Ansible playbook that validates the configuration that is present on an active Router.
"""
...
...
@@ -27,18 +39,6 @@ def validate_router_config(subscription: Router, callback_route: str) -> None:
)
@step
(
"
Verify IPAM resources for loopback interface
"
)
def
verify_ipam_loopback
(
subscription
:
Router
)
->
None
:
"""
Validate the :term:`IPAM` resources for the loopback interface.
Raises an :class:`orchestrator.utils.errors.ProcessFailureError` if :term:`IPAM` is configured incorrectly.
"""
host_record
=
infoblox
.
find_host_by_fqdn
(
f
"
lo0.
{
subscription
.
router
.
router_fqdn
}
"
)
if
not
host_record
or
str
(
subscription
.
subscription_id
)
not
in
host_record
.
comment
:
msg
=
"
Loopback record is incorrectly configured in IPAM, please investigate this manually!
"
raise
ProcessFailureError
(
msg
)
@workflow
(
"
Validate router configuration
"
,
target
=
Target
.
SYSTEM
,
...
...
@@ -47,15 +47,15 @@ def verify_ipam_loopback(subscription: Router) -> None:
def
validate_router
()
->
StepList
:
"""
Validate an existing, active Router subscription.
* Run an Ansible playbook to verify the configuration is intact.
* Verify that the loopback interface is correctly configured in :term:`IPAM`.
* Redeploy base config to verify the configuration is intact.
"""
return
(
init
>>
store_process_subscription
(
Target
.
SYSTEM
)
>>
unsync
>>
lso_interaction
(
validate_router_config
)
>>
verify_ipam_loopback
>>
lso_interaction
(
validate_router_config
)
>>
resync
>>
done
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment