Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
grid5000
reference-repository
Commits
eabe633b
Commit
eabe633b
authored
May 04, 2016
by
Jérémie Gaidamour
Browse files
[dev] fixed various bugs
parent
9f167f3b
Changes
3
Hide whitespace changes
Inline
Side-by-side
generators/puppet/bindg5k.rb
View file @
eabe633b
...
...
@@ -101,8 +101,7 @@ refapi["sites"].each { |site_uid, site|
if
!
eth_net_uid
.
include?
(
net_uid
)
&&
node
[
'network_adapters'
].
size
>
1
hostsuffix
=
"-
#{
net_uid
}
"
end
new_entry
=
{
:uid
=>
uid
,
:hostsuffix
=>
hostsuffix
,
# cacahuete vs. cacahuete-eth0
...
...
@@ -111,7 +110,7 @@ refapi["sites"].each { |site_uid, site|
entries
[
key
]
<<
new_entry
}
}
}
unless
site
[
key
].
nil?
}
# PDUs
...
...
@@ -127,7 +126,7 @@ refapi["sites"].each { |site_uid, site|
entries
[
'pdus'
]
<<
new_entry
end
}
}
unless
site
[
'pdus'
].
nil?
site
.
fetch
(
"clusters"
).
sort
.
each
{
|
cluster_uid
,
cluster
|
#next if cluster_uid != 'griffon'
...
...
generators/puppet/dhcpg5k.rb
View file @
eabe633b
...
...
@@ -99,29 +99,32 @@ global_hash["sites"].each { |site_uid, site_hash|
"nodes"
=>
site_hash
[
key
],
"network_adapters"
=>
[
"eth"
,
"bmc"
,
"adm"
],
"optional_network_adapters"
=>
[
"bmc"
,
"adm"
]
})
})
unless
site_hash
[
key
].
nil?
}
#
# PDUs
#
# Relocate ip/mac info of PDUS
site_hash
[
'pdus'
].
each
{
|
pdu_uid
,
pdu_hash
|
if
pdu_hash
[
'ip'
]
&&
pdu_hash
[
'mac'
]
pdu_hash
[
'network_adapters'
]
||=
{}
pdu_hash
[
'network_adapters'
][
'pdu'
]
||=
{}
pdu_hash
[
'network_adapters'
][
'pdu'
][
'ip'
]
=
pdu_hash
.
delete
(
'ip'
)
pdu_hash
[
'network_adapters'
][
'pdu'
][
'mac'
]
=
pdu_hash
.
delete
(
'mac'
)
end
}
key
=
'pdus'
write_dhcp_file
({
"filename"
=>
key
+
".conf"
,
"site_uid"
=>
site_uid
,
"nodes"
=>
site_hash
[
'pdus'
],
"network_adapters"
=>
[
'pdu'
],
})
if
!
site_hash
[
'pdus'
].
nil?
# Relocate ip/mac info of PDUS
site_hash
[
'pdus'
].
each
{
|
pdu_uid
,
pdu_hash
|
if
pdu_hash
[
'ip'
]
&&
pdu_hash
[
'mac'
]
pdu_hash
[
'network_adapters'
]
||=
{}
pdu_hash
[
'network_adapters'
][
'pdu'
]
||=
{}
pdu_hash
[
'network_adapters'
][
'pdu'
][
'ip'
]
=
pdu_hash
.
delete
(
'ip'
)
pdu_hash
[
'network_adapters'
][
'pdu'
][
'mac'
]
=
pdu_hash
.
delete
(
'mac'
)
end
}
key
=
'pdus'
write_dhcp_file
({
"filename"
=>
key
+
".conf"
,
"site_uid"
=>
site_uid
,
"nodes"
=>
site_hash
[
'pdus'
],
"network_adapters"
=>
[
'pdu'
],
"optional_network_adapters"
=>
[]
})
end
}
generators/puppet/kadeployg5k.rb
View file @
eabe633b
...
...
@@ -17,7 +17,7 @@ require '../lib/hash/hash.rb'
global_hash
=
load_yaml_file_hierarchy
(
"../../input/grid5000/"
)
$output_dir
=
ENV
[
'puppet_repo'
]
||
'/tmp/puppet-repo'
$conf_dir
=
ENV
[
'conf_dir'
]
||
Pathname
(
"
#{
$output_dir
}
/modules/
lanpower
g5k/generators/"
)
$conf_dir
=
ENV
[
'conf_dir'
]
||
Pathname
(
"
#{
$output_dir
}
/modules/
kadeploy
g5k/generators/"
)
raise
(
"Error:
#{
$conf_dir
}
does not exist. The environment variables are not set propertly"
)
unless
Pathname
(
$conf_dir
).
exist?
# Compute cluster prefix
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment