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
a4b2ba43
Verified
Commit
a4b2ba43
authored
1 year ago
by
Karel van Klink
Browse files
Options
Downloads
Patches
Plain Diff
add module for shared workflow steps
parent
f04758f2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!131
Move provisioning proxy steps to the new LSO endpoint
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gso/utils/workflow_steps.py
+62
-0
62 additions, 0 deletions
gso/utils/workflow_steps.py
with
62 additions
and
0 deletions
gso/utils/workflow_steps.py
0 → 100644
+
62
−
0
View file @
a4b2ba43
"""
Workflow steps that are shared across multiple workflows.
"""
from
typing
import
Any
from
orchestrator
import
step
from
orchestrator.types
import
State
,
UUIDstr
from
gso.services.provisioning_proxy
import
execute_playbook
@step
(
"
[DRY RUN] Deploy base config
"
)
def
deploy_base_config_dry
(
subscription
:
dict
[
str
,
Any
],
tt_number
:
str
,
callback_route
:
str
,
process_id
:
UUIDstr
,
)
->
State
:
"""
Perform a dry run of provisioning base config on a router.
"""
inventory
=
subscription
[
"
router
"
][
"
router_fqdn
"
]
extra_vars
=
{
"
wfo_router_json
"
:
subscription
,
"
dry_run
"
:
True
,
"
verb
"
:
"
deploy
"
,
"
commit_comment
"
:
f
"
GSO_PROCESS_ID:
{
process_id
}
- TT_NUMBER:
{
tt_number
}
- Deploy base config
"
,
}
execute_playbook
(
playbook_name
=
"
base_config.yaml
"
,
callback_route
=
callback_route
,
inventory
=
inventory
,
extra_vars
=
extra_vars
,
)
return
{
"
subscription
"
:
subscription
}
@step
(
"
[FOR REAL] Deploy base config
"
)
def
deploy_base_config_real
(
subscription
:
dict
[
str
,
Any
],
tt_number
:
str
,
callback_route
:
str
,
process_id
:
UUIDstr
,
)
->
State
:
"""
Deploy base config on a router using the provisioning proxy.
"""
inventory
=
subscription
[
"
router
"
][
"
router_fqdn
"
]
extra_vars
=
{
"
wfo_router_json
"
:
subscription
,
"
dry_run
"
:
False
,
"
verb
"
:
"
deploy
"
,
"
commit_comment
"
:
f
"
GSO_PROCESS_ID:
{
process_id
}
- TT_NUMBER:
{
tt_number
}
- Deploy base config
"
,
}
execute_playbook
(
playbook_name
=
"
base_config.yaml
"
,
callback_route
=
callback_route
,
inventory
=
inventory
,
extra_vars
=
extra_vars
,
)
return
{
"
subscription
"
:
subscription
}
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