Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LSO
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
GÉANT Orchestration and Automation Team
GAP
LSO
Commits
13f8f94e
Commit
13f8f94e
authored
1 year ago
by
Simone Spinelli
Committed by
Karel van Klink
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Add TTnumber and processID to all LSO calls
parent
73781c03
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!45
Migrate iptrunks ansible integration
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lso/routes/ip_trunk.py
+16
-13
16 additions, 13 deletions
lso/routes/ip_trunk.py
lso/routes/router.py
+3
-1
3 additions, 1 deletion
lso/routes/router.py
with
19 additions
and
14 deletions
lso/routes/ip_trunk.py
+
16
−
13
View file @
13f8f94e
...
@@ -19,6 +19,8 @@ class IPTrunkParams(BaseModel):
...
@@ -19,6 +19,8 @@ class IPTrunkParams(BaseModel):
callback
:
HttpUrl
callback
:
HttpUrl
#: A dictionary representation of the IP trunk subscription that is to be provisioned.
#: A dictionary representation of the IP trunk subscription that is to be provisioned.
subscription
:
dict
subscription
:
dict
tt_number
:
str
process_id
:
str
class
IPTrunkProvisioningParams
(
IPTrunkParams
):
class
IPTrunkProvisioningParams
(
IPTrunkParams
):
...
@@ -52,7 +54,7 @@ class IPTrunkMigrationParams(IPTrunkParams):
...
@@ -52,7 +54,7 @@ class IPTrunkMigrationParams(IPTrunkParams):
new_side
:
dict
new_side
:
dict
#: An Ansible playbook verb that is passed along for indicating the phase of the migration that is performed.
#: An Ansible playbook verb that is passed along for indicating the phase of the migration that is performed.
verb
:
str
verb
:
str
config_object
:
str
class
IPTrunkCheckParams
(
IPTrunkParams
):
class
IPTrunkCheckParams
(
IPTrunkParams
):
"""
Additional parameters for checking an IPtrunk.
"""
"""
Additional parameters for checking an IPtrunk.
"""
...
@@ -86,8 +88,7 @@ def provision_ip_trunk(params: IPTrunkProvisioningParams) -> PlaybookLaunchRespo
...
@@ -86,8 +88,7 @@ def provision_ip_trunk(params: IPTrunkProvisioningParams) -> PlaybookLaunchRespo
"
dry_run
"
:
str
(
params
.
dry_run
),
"
dry_run
"
:
str
(
params
.
dry_run
),
"
verb
"
:
"
deploy
"
,
"
verb
"
:
"
deploy
"
,
"
config_object
"
:
params
.
object
,
"
config_object
"
:
params
.
object
,
"
commit_comment
"
:
f
"
IPtrunk
{
params
.
subscription
[
'
iptrunk
'
][
'
geant_s_sid
'
]
}
"
"
commit_comment
"
:
f
"
GSO_PROCESS_ID:
{
params
.
process_id
}
- TT_NUMBER:
{
params
.
tt_number
}
- Deploy config for
{
params
.
subscription
[
'
iptrunk
'
][
'
geant_s_sid
'
]
}
"
,
f
"
(
{
params
.
subscription
[
'
subscription_id
'
]
}
) - deployment of
{
params
.
object
}
"
,
}
}
return
run_playbook
(
return
run_playbook
(
...
@@ -117,9 +118,7 @@ def modify_ip_trunk(params: IPTrunkModifyParams) -> PlaybookLaunchResponse:
...
@@ -117,9 +118,7 @@ def modify_ip_trunk(params: IPTrunkModifyParams) -> PlaybookLaunchResponse:
"
old_wfo_trunk_json
"
:
params
.
old_subscription
,
"
old_wfo_trunk_json
"
:
params
.
old_subscription
,
"
dry_run
"
:
str
(
params
.
dry_run
),
"
dry_run
"
:
str
(
params
.
dry_run
),
"
verb
"
:
"
modify
"
,
"
verb
"
:
"
modify
"
,
"
commit_comment
"
:
f
"
IPtrunk
"
"
commit_comment
"
:
f
"
GSO_PROCESS_ID:
{
params
.
process_id
}
- TT_NUMBER:
{
params
.
tt_number
}
- Modify config for
{
params
.
subscription
[
'
iptrunk
'
][
'
geant_s_sid
'
]
}
"
,
f
"
{
params
.
subscription
[
'
iptrunk
'
][
'
geant_s_sid
'
]
}
"
f
"
(
{
params
.
subscription
[
'
subscription_id
'
]
}
)
"
,
}
}
return
run_playbook
(
return
run_playbook
(
...
@@ -150,10 +149,7 @@ def delete_ip_trunk(params: IPTrunkDeleteParams) -> PlaybookLaunchResponse:
...
@@ -150,10 +149,7 @@ def delete_ip_trunk(params: IPTrunkDeleteParams) -> PlaybookLaunchResponse:
"
dry_run
"
:
str
(
params
.
dry_run
),
"
dry_run
"
:
str
(
params
.
dry_run
),
"
verb
"
:
"
terminate
"
,
"
verb
"
:
"
terminate
"
,
"
config_object
"
:
"
trunk_deprovision
"
,
"
config_object
"
:
"
trunk_deprovision
"
,
"
commit_comment
"
:
f
"
IPtrunk
"
"
commit_comment
"
:
f
"
GSO_PROCESS_ID:
{
params
.
process_id
}
- TT_NUMBER:
{
params
.
tt_number
}
- Remove config for
{
params
.
subscription
[
'
iptrunk
'
][
'
geant_s_sid
'
]
}
"
,
f
"
{
params
.
subscription
[
'
iptrunk
'
][
'
geant_s_sid
'
]
}
"
f
"
(
{
params
.
subscription
[
'
subscription_id
'
]
}
)
"
f
"
- termination
"
,
}
}
return
run_playbook
(
return
run_playbook
(
...
@@ -204,18 +200,25 @@ def migrate_ip_trunk(params: IPTrunkMigrationParams) -> PlaybookLaunchResponse:
...
@@ -204,18 +200,25 @@ def migrate_ip_trunk(params: IPTrunkMigrationParams) -> PlaybookLaunchResponse:
"""
"""
extra_vars
=
{
extra_vars
=
{
"
wfo_trunk_json
"
:
params
.
subscription
,
"
wfo_trunk_json
"
:
params
.
subscription
,
"
new_side
"
:
params
.
new_side
,
"
new_node
"
:
params
.
new_side
[
"
new_node
"
],
"
dry_run
"
:
str
(
params
.
dry_run
),
"
new_lag_interface
"
:
params
.
new_side
[
"
new_lag_interface
"
],
"
new_lag_member_interfaces
"
:
params
.
new_side
[
"
new_lag_member_interfaces
"
],
"
replace_index
"
:
params
.
new_side
[
"
replace_index
"
],
"
verb
"
:
params
.
verb
,
"
verb
"
:
params
.
verb
,
"
config_object
"
:
params
.
config_object
,
"
dry_run
"
:
str
(
params
.
dry_run
),
"
commit_comment
"
:
f
"
GSO_PROCESS_ID:
{
params
.
process_id
}
- TT_NUMBER:
{
params
.
tt_number
}
- Migrating -
{
params
.
verb
}
-
{
params
.
subscription
[
'
iptrunk
'
][
'
geant_s_sid
'
]
}
"
,
}
}
return
run_playbook
(
return
run_playbook
(
playbook_path
=
path
.
join
(
config_params
.
ansible_playbooks_root_dir
,
"
iptrunks.yaml
"
),
playbook_path
=
path
.
join
(
config_params
.
ansible_playbooks_root_dir
,
"
iptrunks
_migration
.yaml
"
),
inventory
=
str
(
inventory
=
str
(
params
.
subscription
[
"
iptrunk
"
][
"
iptrunk_sides
"
][
0
][
"
iptrunk_side_node
"
][
"
router_fqdn
"
]
params
.
subscription
[
"
iptrunk
"
][
"
iptrunk_sides
"
][
0
][
"
iptrunk_side_node
"
][
"
router_fqdn
"
]
+
"
\n
"
+
"
\n
"
+
params
.
subscription
[
"
iptrunk
"
][
"
iptrunk_sides
"
][
1
][
"
iptrunk_side_node
"
][
"
router_fqdn
"
]
+
params
.
subscription
[
"
iptrunk
"
][
"
iptrunk_sides
"
][
1
][
"
iptrunk_side_node
"
][
"
router_fqdn
"
]
+
"
\n
"
+
"
\n
"
+
params
.
new_side
[
"
new_node
"
][
"
router
"
][
"
router_fqdn
"
]
+
"
\n
"
),
),
extra_vars
=
extra_vars
,
extra_vars
=
extra_vars
,
callback
=
params
.
callback
,
callback
=
params
.
callback
,
...
...
This diff is collapsed.
Click to expand it.
lso/routes/router.py
+
3
−
1
View file @
13f8f94e
...
@@ -30,6 +30,8 @@ class NodeProvisioningParams(BaseModel):
...
@@ -30,6 +30,8 @@ class NodeProvisioningParams(BaseModel):
#: Whether this playbook execution should be a dry run, or run for real. Defaults to ``True`` for obvious reasons,
#: Whether this playbook execution should be a dry run, or run for real. Defaults to ``True`` for obvious reasons,
#: also making it an optional parameter.
#: also making it an optional parameter.
dry_run
:
Optional
[
bool
]
=
True
dry_run
:
Optional
[
bool
]
=
True
tt_number
:
str
process_id
:
str
@router.post
(
"
/
"
)
@router.post
(
"
/
"
)
...
@@ -45,7 +47,7 @@ async def provision_node(params: NodeProvisioningParams) -> playbook.PlaybookLau
...
@@ -45,7 +47,7 @@ async def provision_node(params: NodeProvisioningParams) -> playbook.PlaybookLau
"
wfo_router_json
"
:
params
.
subscription
,
"
wfo_router_json
"
:
params
.
subscription
,
"
dry_run
"
:
str
(
params
.
dry_run
),
"
dry_run
"
:
str
(
params
.
dry_run
),
"
verb
"
:
"
deploy
"
,
"
verb
"
:
"
deploy
"
,
"
commit_comment
"
:
"
Base config deployed with WFO/LSO & Ansible
"
,
"
commit_comment
"
:
f
"
GSO_PROCESS_ID:
{
params
.
process_id
}
- TT_NUMBER:
{
params
.
tt_number
}
- Deploy base config
"
,
}
}
playbook_path
=
os
.
path
.
join
(
config_params
.
ansible_playbooks_root_dir
,
"
base_config.yaml
"
)
playbook_path
=
os
.
path
.
join
(
config_params
.
ansible_playbooks_root_dir
,
"
base_config.yaml
"
)
...
...
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