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
Show more breadcrumbs
grid5000
reference-repository
Commits
9a1f4ba3
Commit
9a1f4ba3
authored
11 months ago
by
POUILLOUX Laurent
Committed by
PAULIN Nathan
7 months ago
Browse files
Options
Downloads
Patches
Plain Diff
[puppet:webfish] sort nodes
parent
e0db06de
No related branches found
No related tags found
1 merge request
!766
[webfish] modification des fichiers yaml des serveurs d'infra et des clusters
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/refrepo/gen/puppet/webfish.rb
+16
-11
16 additions, 11 deletions
lib/refrepo/gen/puppet/webfish.rb
with
16 additions
and
11 deletions
lib/refrepo/gen/puppet/webfish.rb
+
16
−
11
View file @
9a1f4ba3
...
...
@@ -96,13 +96,14 @@ def add_credentials(credentials, allBmc)
next
end
# bmc password is global for cluster nodes
nodeName
=
uid
?
uid
.
slice
(
/\w*/
)
:
uid
nodeName
=
n
[
'node'
]
?
uid
.
slice
(
/\w*/
)
:
uid
begin
n
[
'login'
],
n
[
'password'
]
=
credentials
[
s_site
][
nodeName
].
split
()
rescue
NoMethodError
p
(
uid
+
" has no password in list "
+
s_site
)
n
[
'error'
]
=
"no password defined in console-password.yaml"
rescue
=>
error
p
"infra :uid
#{
uid
}
, url
#{
n
[
'url'
]
}
mon potentiel password :
#{
credentials
[
s_site
][
uid
]
}
, site
#{
s_site
}
, error :
#{
error
.
class
}
error message:
#{
error
}
, nodeName :
#{
nodeName
}
"
#
p "infra :uid #{uid}, url #{n['url']} mon potentiel password : #{credentials[s_site][uid]}, site #{s_site}, error : #{error.class} error message: #{error}, nodeName : #{nodeName}"
n
[
'error'
]
=
error
.
class
end
end
...
...
@@ -112,17 +113,21 @@ end
def
gen_json_files
(
allBmc
,
options
)
allBmc
.
each
do
|
s_site
,
_d_array
|
dir
=
"
#{
options
[
:output_dir
]
}
/platforms/production/modules/generated/files/grid5000/webfish/"
+
s_site
pretty_dict
=
{}
if
!
Dir
.
exist?
(
dir
)
Dir
.
mkdir
(
dir
)
end
actualFile
=
dir
+
"/webfish.json"
dir
=
"
#{
options
[
:output_dir
]
}
/platforms/production/modules/generated/files/grid5000/webfish"
File
.
open
(
actualFile
,
"w"
)
do
|
f
|
f
.
write
(
JSON
.
pretty_generate
(
allBmc
[
s_site
]))
end
if
!
Dir
.
exist?
(
dir
)
Dir
.
mkdir
(
dir
)
end
actualFile
=
dir
+
"/webfish.json"
allBmc
.
each
do
|
s_site
,
_d_array
|
pretty_dict
[
s_site
]
=
allBmc
[
s_site
].
sort_by
{
|
k
,
_
|
[
k
[
/(\D+)/
,
1
],
k
[
/(\d+)/
,
1
].
to_i
,
k
[
/-(\d+)/
,
1
].
to_i
]}.
to_h
end
File
.
open
(
actualFile
,
"w"
)
do
|
f
|
f
.
write
(
JSON
.
pretty_generate
(
pretty_dict
))
end
end
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