Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
reference-repository
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
Admin message
GitLab upgrade completed. Current version is 17.11.3.
Show more breadcrumbs
grid5000
reference-repository
Commits
00666917
Commit
00666917
authored
11 months ago
by
Lucas Nussbaum
Browse files
Options
Downloads
Patches
Plain Diff
[input_loader & gens] allow sites without kavlan
parent
ec5daf16
No related branches found
No related tags found
1 merge request
!717
Draft: Allow sites without kavlan ; make strasbourg such a site
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/refrepo/gen/puppet/kavlang5k.rb
+1
-0
1 addition, 0 deletions
lib/refrepo/gen/puppet/kavlang5k.rb
lib/refrepo/gen/puppet/stitcherg5k.rb
+1
-0
1 addition, 0 deletions
lib/refrepo/gen/puppet/stitcherg5k.rb
lib/refrepo/input_loader.rb
+1
-0
1 addition, 0 deletions
lib/refrepo/input_loader.rb
with
3 additions
and
0 deletions
lib/refrepo/gen/puppet/kavlang5k.rb
+
1
−
0
View file @
00666917
...
@@ -42,6 +42,7 @@ def generate_puppet_kavlang5k(options)
...
@@ -42,6 +42,7 @@ def generate_puppet_kavlang5k(options)
refapi
[
'sites'
].
each
{
|
site_uid
,
site_refapi
|
refapi
[
'sites'
].
each
{
|
site_uid
,
site_refapi
|
next
if
not
site_refapi
[
'kavlans'
]
# skip sites without kavlan
next
unless
options
[
:sites
].
include?
(
site_uid
)
next
unless
options
[
:sites
].
include?
(
site_uid
)
conf
=
YAML
::
load
(
ERB
.
new
(
File
.
read
(
"
#{
options
[
:conf_dir
]
}
/kavlang5k.yaml"
),
trim_mode:
'-'
).
result
(
binding
))[
site_uid
]
conf
=
YAML
::
load
(
ERB
.
new
(
File
.
read
(
"
#{
options
[
:conf_dir
]
}
/kavlang5k.yaml"
),
trim_mode:
'-'
).
result
(
binding
))[
site_uid
]
...
...
This diff is collapsed.
Click to expand it.
lib/refrepo/gen/puppet/stitcherg5k.rb
+
1
−
0
View file @
00666917
...
@@ -36,6 +36,7 @@ end
...
@@ -36,6 +36,7 @@ end
def
build_stitcher_kavlans_hash
(
refapi
)
def
build_stitcher_kavlans_hash
(
refapi
)
stitcher_kavlans_hash
=
{}
stitcher_kavlans_hash
=
{}
refapi
[
'sites'
].
each
do
|
name
,
site_hash
|
refapi
[
'sites'
].
each
do
|
name
,
site_hash
|
next
if
not
site_hash
[
'kavlans'
]
# skip sites without kavlan
global_kavlan
=
site_hash
[
'kavlans'
].
select
{
|
id
,
_hash
|
id
=~
/\d\d/
}.
first
global_kavlan
=
site_hash
[
'kavlans'
].
select
{
|
id
,
_hash
|
id
=~
/\d\d/
}.
first
global_kavlan_id
=
global_kavlan
.
first
.
to_i
global_kavlan_id
=
global_kavlan
.
first
.
to_i
stitcher_kavlans_hash
[
global_kavlan_id
]
=
{
"vlan"
=>
700
+
global_kavlan_id
,
"site"
=>
name
}
stitcher_kavlans_hash
[
global_kavlan_id
]
=
{
"vlan"
=>
700
+
global_kavlan_id
,
"site"
=>
name
}
...
...
This diff is collapsed.
Click to expand it.
lib/refrepo/input_loader.rb
+
1
−
0
View file @
00666917
...
@@ -507,6 +507,7 @@ def add_kavlan_ipv6s(h)
...
@@ -507,6 +507,7 @@ def add_kavlan_ipv6s(h)
h
[
'ipv6'
][
'site_global_kavlans'
].
each
{
|
key
,
value
|
global_vlan_site
[
value
]
=
key
}
h
[
'ipv6'
][
'site_global_kavlans'
].
each
{
|
key
,
value
|
global_vlan_site
[
value
]
=
key
}
# Set kavlan ipv6 informations at site level
# Set kavlan ipv6 informations at site level
h
[
'sites'
].
each_pair
do
|
site_uid
,
hs
|
h
[
'sites'
].
each_pair
do
|
site_uid
,
hs
|
next
if
not
hs
[
'kavlans'
]
# skip sites without kavlan
site_prefix
=
IPAddress
hs
[
'ipv6'
][
'prefix'
]
site_prefix
=
IPAddress
hs
[
'ipv6'
][
'prefix'
]
kavlan_ids
=
h
[
'vlans'
][
'base'
].
map
{
|
k
,
v
|
k
if
v
[
"type"
]
=~
/local|routed/
}.
compact
+
[
h
[
'ipv6'
][
'site_global_kavlans'
][
site_uid
]]
kavlan_ids
=
h
[
'vlans'
][
'base'
].
map
{
|
k
,
v
|
k
if
v
[
"type"
]
=~
/local|routed/
}.
compact
+
[
h
[
'ipv6'
][
'site_global_kavlans'
][
site_uid
]]
kavlan_ids
.
each
do
|
kvl_id
|
kavlan_ids
.
each
do
|
kvl_id
|
...
...
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