From: Tom Hughes Date: Thu, 19 Jul 2018 07:49:09 +0000 (+0100) Subject: Update IP addresses for move from Imperial to Amsterdam X-Git-Url: https://git.openstreetmap.org./chef.git/commitdiff_plain/85625531ef385b5be17fe2b0de369e3f1af2527b Update IP addresses for move from Imperial to Amsterdam --- diff --git a/cookbooks/networking/recipes/default.rb b/cookbooks/networking/recipes/default.rb index 2d6f83b38..85472b316 100644 --- a/cookbooks/networking/recipes/default.rb +++ b/cookbooks/networking/recipes/default.rb @@ -25,23 +25,27 @@ require "ipaddr" network_packages = [] node[:networking][:interfaces].each do |name, interface| - network_packages |= ["vlan"] if interface[:interface] =~ /\.\d+$/ - network_packages |= ["ifenslave"] if interface[:bond] + if interface[:interface] + network_packages |= ["vlan"] if interface[:interface] =~ /\.\d+$/ + network_packages |= ["ifenslave"] if interface[:bond] + + if interface[:role] && (role = node[:networking][:roles][interface[:role]]) + if role[interface[:family]] + node.normal[:networking][:interfaces][name][:prefix] = role[interface[:family]][:prefix] + node.normal[:networking][:interfaces][name][:gateway] = role[interface[:family]][:gateway] + end - if interface[:role] && (role = node[:networking][:roles][interface[:role]]) - if role[interface[:family]] - node.normal[:networking][:interfaces][name][:prefix] = role[interface[:family]][:prefix] - node.normal[:networking][:interfaces][name][:gateway] = role[interface[:family]][:gateway] + node.normal[:networking][:interfaces][name][:metric] = role[:metric] + node.normal[:networking][:interfaces][name][:zone] = role[:zone] end - node.normal[:networking][:interfaces][name][:metric] = role[:metric] - node.normal[:networking][:interfaces][name][:zone] = role[:zone] - end - - prefix = node[:networking][:interfaces][name][:prefix] + prefix = node[:networking][:interfaces][name][:prefix] - node.normal[:networking][:interfaces][name][:netmask] = (~IPAddr.new(interface[:address]).mask(0)).mask(prefix) - node.normal[:networking][:interfaces][name][:network] = IPAddr.new(interface[:address]).mask(prefix) + node.normal[:networking][:interfaces][name][:netmask] = (~IPAddr.new(interface[:address]).mask(0)).mask(prefix) + node.normal[:networking][:interfaces][name][:network] = IPAddr.new(interface[:address]).mask(prefix) + else + node.rm(:networking, :interfaces, name) + end end package network_packages diff --git a/roles/dulcy.rb b/roles/dulcy.rb index adf37e26e..f444ded44 100644 --- a/roles/dulcy.rb +++ b/roles/dulcy.rb @@ -4,26 +4,27 @@ description "Master role applied to dulcy" default_attributes( :networking => { :interfaces => { - :external_ipv4 => { - :interface => "p18p1", - :role => :external, + :internal_ipv4 => { + :interface => "bond0", + :role => :internal, :family => :inet, - :address => "193.63.75.109", - :hwaddress => "0c:c4:7a:66:96:d2" + :address => "10.0.48.1", + :bond => { + :slaves => %w[p18p1 p18p2] + } }, - :external_ipv6 => { - :interface => "p18p1", + :external_ipv4 => { + :interface => "bond0.3", :role => :external, - :family => :inet6, - :address => "2001:630:12:500:ec4:7aff:fe66:96d2" - }, - :internal_ipv4 => { - :interface => "p18p2", - :role => :internal, :family => :inet, - :address => "146.179.159.179", - :hwaddress => "0c:c4:7a:66:96:d3" - } + :address => "130.117.76.1" + }, + # :external_ipv6 => { + # :interface => "bond0.3", + # :role => :external, + # :family => :inet6, + # :address => "2001:978:2:2C::172:1001" + # } } }, :postgresql => { diff --git a/roles/ic.rb b/roles/ic.rb index 33e99624b..ae991575a 100644 --- a/roles/ic.rb +++ b/roles/ic.rb @@ -12,19 +12,19 @@ default_attributes( :roles => { :internal => { :inet => { - :prefix => "27", - :gateway => "146.179.159.177" + :prefix => "20", + :gateway => "10.0.48.2" } }, :external => { :zone => "ic", :inet => { :prefix => "27", - :gateway => "193.63.75.97" + :gateway => "130.117.76.30" }, :inet6 => { :prefix => "64", - :gateway => "fe80::5:73ff:fea0:1" + :gateway => "2001:978:2:2C::172:2" } } } diff --git a/roles/ironbelly.rb b/roles/ironbelly.rb index ab0673089..d25754003 100644 --- a/roles/ironbelly.rb +++ b/roles/ironbelly.rb @@ -25,23 +25,26 @@ default_attributes( :networking => { :interfaces => { :internal_ipv4 => { - :interface => "eth0", + :interface => "bond0", :role => :internal, :family => :inet, - :address => "146.179.159.177" + :address => "10.0.48.2", + :bond => { + :slaves => %w[eth0 eth1] + } }, :external_ipv4 => { - :interface => "eth1", + :interface => "bond0.3", :role => :external, :family => :inet, - :address => "193.63.75.107" + :address => "130.117.76.2" }, - :external_ipv6 => { - :interface => "eth1", - :role => :external, - :family => :inet6, - :address => "2001:630:12:500:225:90ff:fec4:f6ef" - } + # :external_ipv6 => { + # :interface => "bond0.3", + # :role => :external, + # :family => :inet6, + # :address => "2001:978:2:2C::172:1002" + # } } }, :openvpn => { diff --git a/roles/karm.rb b/roles/karm.rb index 5fbfd9d09..a9c529f23 100644 --- a/roles/karm.rb +++ b/roles/karm.rb @@ -11,11 +11,13 @@ default_attributes( :networking => { :interfaces => { :internal_ipv4 => { - :interface => "enp1s0f0", + :interface => "bond0", :role => :internal, :family => :inet, - :address => "146.179.159.168", - :hwaddress => "0c:c4:7a:a3:aa:ac" + :address => "10.0.48.50", + :bond => { + :slaves => %w[enp1s0f0 enp1s0f1] + } } } }, diff --git a/roles/orm.rb b/roles/orm.rb index 5e4c83135..99bc7b2b1 100644 --- a/roles/orm.rb +++ b/roles/orm.rb @@ -31,18 +31,27 @@ default_attributes( }, :networking => { :interfaces => { + :internal_ipv4 => { + :interface => "bond0", + :role => :internal, + :family => :inet, + :address => "10.0.48.3", + :bond => { + :slaves => %w[eth0 eth1] + } + }, :external_ipv4 => { - :interface => "eth0", + :interface => "bond0.3", :role => :external, :family => :inet, - :address => "193.63.75.98" + :address => "130.117.76.3" }, - :external_ipv6 => { - :interface => "eth0", - :role => :external, - :family => :inet6, - :address => "2001:630:12:500:2e0:81ff:fec5:2a8c" - } + # :external_ipv6 => { + # :interface => "bond0.3", + # :role => :external, + # :family => :inet6, + # :address => "2001:978:2:2C::172:1003" + # }, } }, :postgresql => { diff --git a/roles/ouroboros.rb b/roles/ouroboros.rb index ce27c8612..288daee19 100644 --- a/roles/ouroboros.rb +++ b/roles/ouroboros.rb @@ -5,25 +5,26 @@ default_attributes( :networking => { :interfaces => { :internal_ipv4 => { - :interface => "eth0", + :interface => "bond0", :role => :internal, :family => :inet, - :address => "146.179.159.172", - :hwaddress => "00:23:7d:ea:81:38" + :address => "10.0.48.4", + :bond => { + :slaves => %w[eth0 eth1] + } }, :external_ipv4 => { - :interface => "eth1", + :interface => "bond0.3", :role => :external, :family => :inet, - :address => "193.63.75.106", - :hwaddress => "00:23:7d:ea:81:3a" + :address => "130.117.76.4" }, - :external_ipv6 => { - :interface => "eth1", - :role => :external, - :family => :inet6, - :address => "2001:630:12:500:223:7dff:feea:813a" - } + # :external_ipv6 => { + # :interface => "bond0.3", + # :role => :external, + # :family => :inet6, + # :address => "2001:978:2:2C::172:1004" + # } } } ) diff --git a/roles/ramoth.rb b/roles/ramoth.rb index fad21355a..77f596976 100644 --- a/roles/ramoth.rb +++ b/roles/ramoth.rb @@ -46,11 +46,13 @@ default_attributes( :networking => { :interfaces => { :internal_ipv4 => { - :interface => "eth0", + :interface => "bond0", :role => :internal, :family => :inet, - :address => "146.179.159.170", - :hwaddress => "00:25:90:4b:05:9a" + :address => "10.0.48.5", + :bond => { + :slaves => %w[eth0 eth1] + } } } }, diff --git a/roles/spike-01.rb b/roles/spike-01.rb index a7c45da02..05fcf144a 100644 --- a/roles/spike-01.rb +++ b/roles/spike-01.rb @@ -5,26 +5,26 @@ default_attributes( :networking => { :interfaces => { :internal_ipv4 => { - :interface => "eth0", + :interface => "bond0", :role => :internal, :family => :inet, - :address => "146.179.159.162", - :hwaddress => "00:1a:4b:a5:0f:ca" + :address => "10.0.48.6", + :bond => { + :slaves => %w[eth0 eth1] + } }, :external_ipv4 => { - :interface => "eth1", + :interface => "bond0.3", :role => :external, :family => :inet, - :address => "193.63.75.99", - :hwaddress => "00:1a:4b:a5:fd:2a" + :address => "130.117.76.6" }, - :external_ipv6 => { - :interface => "eth1", - :role => :external, - :family => :inet6, - :address => "2001:630:12:500:21a:4bff:fea5:fd2a", - :hwaddress => "00:1a:4b:a5:fd:2a" - } + # :external_ipv6 => { + # :interface => "bond0.3", + # :role => :external, + # :family => :inet6, + # :address => "2001:978:2:2C::172:1006" + # } } }, :sysctl => { diff --git a/roles/spike-02.rb b/roles/spike-02.rb index 84ee0b118..e0d03d220 100644 --- a/roles/spike-02.rb +++ b/roles/spike-02.rb @@ -5,26 +5,26 @@ default_attributes( :networking => { :interfaces => { :internal_ipv4 => { - :interface => "eth0", + :interface => "bond0", :role => :internal, :family => :inet, - :address => "146.179.159.163", - :hwaddress => "00:1b:78:04:76:c0" + :address => "10.0.48.7", + :bond => { + :slaves => %w[eth0 eth1] + } }, :external_ipv4 => { - :interface => "eth1", + :interface => "bond0.3", :role => :external, :family => :inet, - :address => "193.63.75.100", - :hwaddress => "00:1b:78:04:a5:5a" + :address => "130.117.76.7" }, - :external_ipv6 => { - :interface => "eth1", - :role => :external, - :family => :inet6, - :address => "2001:630:12:500:219:bbff:fe39:3d9e", - :hwaddress => "00:1b:78:04:a5:5a" - } + # :external_ipv6 => { + # :interface => "bond0.3", + # :role => :external, + # :family => :inet6, + # :address => "2001:978:2:2C::172:1007" + # } } }, :sysctl => { diff --git a/roles/spike-03.rb b/roles/spike-03.rb index ee85b29d3..d4f9e208c 100644 --- a/roles/spike-03.rb +++ b/roles/spike-03.rb @@ -5,26 +5,26 @@ default_attributes( :networking => { :interfaces => { :internal_ipv4 => { - :interface => "eth0", + :interface => "bond0", :role => :internal, :family => :inet, - :address => "146.179.159.171", - :hwaddress => "00:19:bb:39:8a:bc" + :address => "10.0.48.8", + :bond => { + :slaves => %w[eth0 eth1] + } }, :external_ipv4 => { - :interface => "eth1", + :interface => "bond0.3", :role => :external, :family => :inet, - :address => "193.63.75.103", - :hwaddress => "00:19:bb:39:8a:ba" + :address => "130.117.76.8" }, - :external_ipv6 => { - :interface => "eth1", - :role => :external, - :family => :inet6, - :address => "2001:630:12:500:219:bbff:fe39:8aba", - :hwaddress => "00:19:bb:39:8a:ba" - } + # :external_ipv6 => { + # :interface => "bond0.3", + # :role => :external, + # :family => :inet6, + # :address => "2001:978:2:2C::172:1008" + # } } }, :sysctl => { diff --git a/roles/thorn-01.rb b/roles/thorn-01.rb index b06587b5e..e729c4e98 100644 --- a/roles/thorn-01.rb +++ b/roles/thorn-01.rb @@ -5,10 +5,13 @@ default_attributes( :networking => { :interfaces => { :internal_ipv4 => { - :interface => "eth0", + :interface => "bond0", :role => :internal, :family => :inet, - :address => "146.179.159.165" + :address => "10.0.48.51", + :bond => { + :slaves => %w[eth0 eth1] + } } } }, diff --git a/roles/thorn-02.rb b/roles/thorn-02.rb index b226c3637..84f3ccd38 100644 --- a/roles/thorn-02.rb +++ b/roles/thorn-02.rb @@ -5,10 +5,13 @@ default_attributes( :networking => { :interfaces => { :internal_ipv4 => { - :interface => "eth0", + :interface => "bond0", :role => :internal, :family => :inet, - :address => "146.179.159.166" + :address => "10.0.48.52", + :bond => { + :slaves => %w[eth0 eth1] + } } } }, diff --git a/roles/thorn-03.rb b/roles/thorn-03.rb index 1ff3ef69b..09e948d88 100644 --- a/roles/thorn-03.rb +++ b/roles/thorn-03.rb @@ -5,10 +5,13 @@ default_attributes( :networking => { :interfaces => { :internal_ipv4 => { - :interface => "eth0", + :interface => "bond0", :role => :internal, :family => :inet, - :address => "146.179.159.167" + :address => "10.0.48.53", + :bond => { + :slaves => %w[eth0 eth1] + } } } },