Commit 499f6e02 authored by Lucas Nussbaum's avatar Lucas Nussbaum Committed by Simon Delamare

[dev/kavlan] drop usage of ruby-ip

parent 5bca6893
Pipeline #63327 passed with stages
in 1 minute and 30 seconds
......@@ -5,7 +5,6 @@ gem "hashdiff"
gem "diffy"
gem "mediawiki_api"
gem "net-ssh"
gem "ruby-ip"
gem "dns-zone"
gem "ruby-cute", :require => "cute"
gem "peach"
......
......@@ -48,7 +48,6 @@ GEM
json (>= 1.8)
net-ssh-multi (>= 1.2)
rest-client (>= 1.6)
ruby-ip (0.9.3)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.2)
......
# !!! Require to "gem install ruby-ip", do not install "ip" gem !!!
require 'refrepo/hash/hash'
def generate_puppet_kavlang5k(options)
......
......@@ -11,19 +11,18 @@ option pxelinux.reboottime code 211 = unsigned integer 32;
option vendorinfo code 43 = string;
<%
require 'ip'
kavlan = refapi['sites'][site_uid]['kavlans'][kavlan_id]
kavlan_ip = IP.new(kavlan['network'])
kavlan_ip = IPAddress::IPv4::new(kavlan['network'])
-%>
subnet <%= kavlan_ip.network.to_addr %> netmask <%= kavlan_ip.netmask.to_addr %> {
subnet <%= kavlan_ip.network %> netmask <%= kavlan_ip.netmask %> {
default-lease-time 86400;
max-lease-time 604800;
option domain-name-servers <%= kavlan_id.to_i.between?(1, 3)? kavlan['gateway'] : "dns.#{site_uid}.grid5000.fr" %>;
option ntp-servers <%= kavlan_id.to_i.between?(1, 3)? kavlan['gateway'] : "ntp.#{site_uid}.grid5000.fr" %>;
option routers <%= kavlan['gateway'] %>;
option subnet-mask <%= kavlan_ip.netmask.to_addr %>;
option broadcast-address <%= kavlan_ip.broadcast.to_addr %>;
option subnet-mask <%= kavlan_ip.netmask %>;
option broadcast-address <%= kavlan_ip.broadcast %>;
filename "pxelinux.0";
next-server <%= "kadeploy.#{site_uid}.grid5000.fr" %>;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment