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
ffc2cac3
Commit
ffc2cac3
authored
6 years ago
by
COURBET Adrien
Browse files
Options
Downloads
Plain Diff
Merge branch 'kavlanpuppet4'
parents
9fee71ca
096658d8
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#49709
passed
6 years ago
Stage: validate
Stage: generate
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
generators/puppet/kavlang5k.rb
+5
-5
5 additions, 5 deletions
generators/puppet/kavlang5k.rb
generators/puppet/templates/kavlan-dhcp.conf.erb
+1
-1
1 addition, 1 deletion
generators/puppet/templates/kavlan-dhcp.conf.erb
with
6 additions
and
6 deletions
generators/puppet/kavlang5k.rb
+
5
−
5
View file @
ffc2cac3
...
...
@@ -31,7 +31,7 @@ OptionParser.new do |opts|
opts
.
on
(
'-o'
,
'--output-dir dir'
,
String
,
'Select the puppet repo path'
,
"Default: "
+
options
[
:output_dir
])
do
|
d
|
options
[
:output_dir
]
=
d
options
[
:conf_dir
]
=
"
#{
options
[
:output_dir
]
}
/
modules/kavlang5k
/generators/"
options
[
:conf_dir
]
=
"
#{
options
[
:output_dir
]
}
/
platforms/production
/generators/
kavlan
"
end
opts
.
on
(
'-c'
,
'--conf-dir dir'
,
String
,
'Select the kavlan module configuration path'
,
"Default: ./conf-examples"
)
do
|
d
|
...
...
@@ -71,19 +71,19 @@ refapi['sites'].each { |site_uid, site_refapi|
warn
"No generator configuration for site
#{
site_uid
}
found in
#{
options
[
:conf_dir
]
}
/kavlang5k.yaml, skipping kavlan.conf"
else
output
=
ERB
.
new
(
File
.
read
(
File
.
expand_path
(
'templates/kavlan.conf.erb'
,
File
.
dirname
(
__FILE__
))),
nil
,
'-'
).
result
(
binding
)
output_file
=
Pathname
(
"
#{
options
[
:output_dir
]
}
/
modules/kavlang5k/files
/
#{
site_uid
}
/kavlan.conf"
)
output_file
=
Pathname
(
"
#{
options
[
:output_dir
]
}
/
/platforms/production/modules/generated/files/grid5000/kavlan
/
#{
site_uid
}
/kavlan.conf"
)
output_file
.
dirname
.
mkpath
()
File
.
write
(
output_file
,
output
)
end
output
=
ERB
.
new
(
File
.
read
(
File
.
expand_path
(
'templates/kavlan-cluster.conf.erb'
,
File
.
dirname
(
__FILE__
))),
nil
,
'-'
).
result
(
binding
)
output_file
=
Pathname
(
"
#{
options
[
:output_dir
]
}
/
modules/kavlang5k/files
/
#{
site_uid
}
/
#{
site_uid
}
.conf"
)
output_file
=
Pathname
(
"
#{
options
[
:output_dir
]
}
/
/platforms/production/modules/generated/files/grid5000/kavlan
/
#{
site_uid
}
/
#{
site_uid
}
.conf"
)
output_file
.
dirname
.
mkpath
()
File
.
write
(
output_file
,
output
)
(
1
..
9
).
each
do
|
kavlan_id
|
output
=
ERB
.
new
(
File
.
read
(
File
.
expand_path
(
'templates/kavlan-dhcp.conf.erb'
,
File
.
dirname
(
__FILE__
))),
nil
,
'-'
).
result
(
binding
)
output_file
=
Pathname
(
"
#{
options
[
:output_dir
]
}
/
modules/kavlang5k/files
/
#{
site_uid
}
/dhcp/dhcpd-
#{
kavlan_id
}
.conf"
)
output_file
=
Pathname
(
"
#{
options
[
:output_dir
]
}
/
/platforms/production/modules/generated/files/grid5000/kavlan
/
#{
site_uid
}
/dhcp/dhcpd-
#{
kavlan_id
}
.conf"
)
output_file
.
dirname
.
mkpath
()
File
.
write
(
output_file
,
output
)
end
...
...
@@ -91,7 +91,7 @@ refapi['sites'].each { |site_uid, site_refapi|
# Look for site's global kavlan
kavlan_id
=
refapi
[
'sites'
][
site_uid
][
'kavlans'
].
each_key
.
select
{
|
k
|
k
.
is_a?
(
Numeric
)
and
k
>
9
}.
pop
()
output
=
ERB
.
new
(
File
.
read
(
File
.
expand_path
(
'templates/kavlan-dhcp.conf.erb'
,
File
.
dirname
(
__FILE__
))),
nil
,
'-'
).
result
(
binding
)
output_file
=
Pathname
(
"
#{
options
[
:output_dir
]
}
/
modules/kavlang5k/files
/
#{
site_uid
}
/dhcp/dhcpd-0.conf"
)
output_file
=
Pathname
(
"
#{
options
[
:output_dir
]
}
/
/platforms/production/modules/generated/files/grid5000/kavlan
/
#{
site_uid
}
/dhcp/dhcpd-0.conf"
)
File
.
write
(
output_file
,
output
)
}
This diff is collapsed.
Click to expand it.
generators/puppet/templates/kavlan-dhcp.conf.erb
+
1
−
1
View file @
ffc2cac3
...
...
@@ -25,7 +25,7 @@ subnet <%= kavlan_ip.network.to_addr %> netmask <%= kavlan_ip.netmask.to_addr %>
option subnet-mask
<%=
kavlan_ip
.
netmask
.
to_addr
%>
;
option broadcast-address
<%=
kavlan_ip
.
broadcast
.
to_addr
%>
;
filename "pxelinux.0";
next-server
<%=
kavlan_id
.
to_i
.
between?
(
1
,
3
)?
kavlan
[
'gateway'
]
:
"kadeploy.
#{
site_uid
}
.grid5000.fr"
%>
;
next-server
<%=
"kadeploy.
#{
site_uid
}
.grid5000.fr"
%>
;
<%
refapi
[
'sites'
].
sort
.
to_h
.
each_key
do
|
site
|
...
...
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