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
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 => {
: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"
}
}
}
: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 => {
: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]
+ }
}
}
},
},
: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 => {
: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"
+ # }
}
}
)
: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]
+ }
}
}
},
: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 => {
: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 => {
: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 => {
: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]
+ }
}
}
},
: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]
+ }
}
}
},
: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]
+ }
}
}
},