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
Jira
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
0154217a
Commit
0154217a
authored
1 year ago
by
Karel van Klink
Committed by
Neda Moeini
9 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Update playbook validation steps
parent
477896a1
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!139
Feature/add validation workflows
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
gso/workflows/iptrunk/validate_iptrunk.py
+30
-5
30 additions, 5 deletions
gso/workflows/iptrunk/validate_iptrunk.py
gso/workflows/router/validate_router.py
+25
-5
25 additions, 5 deletions
gso/workflows/router/validate_router.py
with
55 additions
and
10 deletions
gso/workflows/iptrunk/validate_iptrunk.py
+
30
−
5
View file @
0154217a
...
...
@@ -15,10 +15,7 @@ from gso.services.lso_client import anonymous_lso_interaction, execute_playbook
from
gso.services.netbox_client
import
NetboxClient
from
gso.utils.helpers
import
get_router_vendor
from
gso.utils.shared_enums
import
Vendor
from
gso.utils.workflow_steps
import
detect_configuration_drift
from
gso.workflows.iptrunk.deploy_twamp
import
deploy_twamp_dry
from
gso.workflows.iptrunk.migrate_iptrunk
import
check_ip_trunk_isis
from
gso.workflows.iptrunk.modify_trunk_interface
import
provision_ip_trunk_iface_dry
@step
(
"
Validate IP trunk configuration
"
)
...
...
@@ -146,6 +143,34 @@ def verify_netbox_entries(subscription: Iptrunk) -> None:
raise
ProcessFailureError
(
message
=
"
NetBox misconfiguration(s) found
"
,
details
=
str
(
netbox_errors
))
@step
(
"
Verify configuration of IPtrunk
"
)
def
verify_iptrunk_config
(
subscription
:
Iptrunk
,
callback_route
:
str
)
->
None
:
"""
Check for configuration drift on the relevant routers.
"""
extra_vars
=
{
"
wfo_trunk_json
"
:
json
.
loads
(
json_dumps
(
subscription
)),
"
verb
"
:
"
check
"
}
execute_playbook
(
playbook_name
=
"
iptrunks.yaml
"
,
callback_route
=
callback_route
,
inventory
=
f
"
{
subscription
.
iptrunk
.
iptrunk_sides
[
0
].
iptrunk_side_node
.
router_fqdn
}
\n
"
f
"
{
subscription
.
iptrunk
.
iptrunk_sides
[
1
].
iptrunk_side_node
.
router_fqdn
}
\n
"
,
extra_vars
=
extra_vars
,
)
@step
(
"
Verify TWAMP configuration
"
)
def
verify_twamp_config
(
subscription
:
Iptrunk
,
callback_route
:
str
)
->
None
:
"""
Check for configuration drift of TWAMP.
"""
extra_vars
=
{
"
subscription
"
:
json
.
loads
(
json_dumps
(
subscription
)),
"
verb
"
:
"
check
"
}
execute_playbook
(
playbook_name
=
"
deploy_twamp.yaml
"
,
callback_route
=
callback_route
,
inventory
=
f
"
{
subscription
.
iptrunk
.
iptrunk_sides
[
0
].
iptrunk_side_node
.
router_fqdn
}
\n
"
f
"
{
subscription
.
iptrunk
.
iptrunk_sides
[
1
].
iptrunk_side_node
.
router_fqdn
}
\n
"
,
extra_vars
=
extra_vars
,
)
@workflow
(
"
Validate IP trunk configuration
"
,
target
=
Target
.
SYSTEM
,
...
...
@@ -166,9 +191,9 @@ def validate_iptrunk() -> StepList:
>>
unsync
>>
verify_ipam_records
>>
verify_netbox_entries
>>
anonymous_lso_interaction
(
provision
_ip
_
trunk_
iface_dry
,
detect_configuration_drift
)
>>
anonymous_lso_interaction
(
verify
_iptrunk_
config
)
>>
anonymous_lso_interaction
(
check_ip_trunk_isis
)
>>
anonymous_lso_interaction
(
deplo
y_twamp_
dry
,
detect_configuration_drift
)
>>
anonymous_lso_interaction
(
verif
y_twamp_
config
)
>>
resync
>>
done
)
This diff is collapsed.
Click to expand it.
gso/workflows/router/validate_router.py
+
25
−
5
View file @
0154217a
...
...
@@ -11,11 +11,9 @@ from gso.products.product_types.router import Router
from
gso.schedules
import
TT_NUMBER_ZERO
from
gso.services
import
infoblox
from
gso.services.librenms_client
import
LibreNMSClient
from
gso.services.lso_client
import
anonymous_lso_interaction
from
gso.services.lso_client
import
anonymous_lso_interaction
,
execute_playbook
from
gso.services.netbox_client
import
NetboxClient
from
gso.utils.shared_enums
import
Vendor
from
gso.utils.workflow_steps
import
deploy_base_config_dry
,
detect_configuration_drift
from
gso.workflows.router.update_ibgp_mesh
import
add_p_to_mesh_dry
@step
(
"
Prepare required keys in state
"
)
...
...
@@ -63,6 +61,28 @@ def verify_librenms_entry(subscription: Router) -> None:
client
.
get_device
(
subscription
.
router
.
router_fqdn
)
@step
(
"
Check base config for drift
"
)
def
verify_base_config
(
subscription
:
Router
,
callback_route
:
str
)
->
None
:
"""
Workflow step for running a playbook that checks whether base config has drifted.
"""
execute_playbook
(
playbook_name
=
"
base_config.yaml
"
,
callback_route
=
callback_route
,
inventory
=
subscription
.
router
.
router_fqdn
,
extra_vars
=
{
"
wfo_router_json
"
:
subscription
,
"
verb
"
:
"
check-drift
"
},
)
@step
(
"
Validate iBGP mesh configuration
"
)
def
validate_ibgp_mesh_config
(
subscription
:
Router
,
callback_route
:
str
)
->
None
:
"""
Workflow step for running a playbook that check iBGP mesh configuration.
"""
execute_playbook
(
playbook_name
=
"
ibgp_checks.yaml
"
,
callback_route
=
callback_route
,
inventory
=
subscription
.
router
.
router_fqdn
,
extra_vars
=
{
"
wfo_router_json
"
:
subscription
},
)
@workflow
(
"
Validate router configuration
"
,
target
=
Target
.
SYSTEM
,
initial_input_form
=
wrap_modify_initial_input_form
(
None
)
)
...
...
@@ -86,8 +106,8 @@ def validate_router() -> StepList:
>>
verify_ipam_loopback
>>
verify_netbox_entry
>>
verify_librenms_entry
>>
anonymous_lso_interaction
(
deplo
y_base_config
_dry
,
detect_configuration_drift
)
>>
anonymous_lso_interaction
(
add_p_to_mesh_dry
,
detect_configuration_drift
)
>>
anonymous_lso_interaction
(
verif
y_base_config
)
>>
anonymous_lso_interaction
(
validate_ibgp_mesh_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