Mentions légales du service

Skip to content
Snippets Groups Projects
Commit de1d3764 authored by IMBERT Matthieu's avatar IMBERT Matthieu
Browse files

[gen] put back ipv6 info in input yaml

parent 4d271024
No related branches found
No related tags found
No related merge requests found
Pipeline #132565 passed
ipv6:
site-indexes:
grenoble: 1
lille: 2
luxembourg: 3
lyon: 4
nancy: 5
nantes: 6
rennes: 7
sophia: 8
...@@ -107,17 +107,6 @@ def add_kavlan_ips(h) ...@@ -107,17 +107,6 @@ def add_kavlan_ips(h)
end end
end end
$ipv6_site_indexes = {
'grenoble' => 1,
'lille' => 2,
'luxembourg' => 3,
'lyon' => 4,
'nancy' => 5,
'nantes' => 6,
'rennes' => 7,
'sophia' => 8,
}
def add_ipv6(h) def add_ipv6(h)
# for each node # for each node
h['sites'].each_pair do |site_uid, hs| h['sites'].each_pair do |site_uid, hs|
...@@ -132,7 +121,7 @@ def add_ipv6(h) ...@@ -132,7 +121,7 @@ def add_ipv6(h)
if not ip4.nil? if not ip4.nil?
# compute and assign IPv6 based on IPv4 # compute and assign IPv6 based on IPv4
ip6 = '2001:660:4406:' ip6 = '2001:660:4406:'
ip6 += '%x' % $ipv6_site_indexes[site_uid] ip6 += '%x' % h['ipv6']['site-indexes'][site_uid]
ip6 += '00:' ip6 += '00:'
ip6 += '%x::' % ((ip4.split('.')[2].to_i & 0b1111) + 1) ip6 += '%x::' % ((ip4.split('.')[2].to_i & 0b1111) + 1)
ip6 += '%x' % (ip4.split('.')[3].to_i) ip6 += '%x' % (ip4.split('.')[3].to_i)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment