class system-base-network-interfaces {
file { "/etc/network/interfaces" :
ensure => present,
content => template("system/base/network/interfaces.erb"),
# notify => Service[networking]
}
service { networking:
ensure => running,
hasrestart => true
}
}
interfaces.erb:
# The loopback network interface
auto lo
iface lo inet loopback
# This is a list of hotpluggable network interfaces.
# They will be activated automatically by the hotplug subsystem.
mapping eth0
script grep
map eth0
# The primary network interface
auto eth0
iface eth0 inet static
address <%= network_address %>
netmask <%= network_netmask %>
gateway <%= network_gateway %>
<% network_routes.each do |route| %>
up ip r a <%= route %>
down ip r d <%= route %>
<% end%>
<% network_ips.each do |ip| %>
up ip a add <%= ip %>
down ip a del <%= ip %>
<% end%>
node avas-lvs-01 {
$network_address = "192.168.179.1"
$network_netmask = "255.255.255.128"
$network_gateway = "192.168.179.126"
$network_routes = ["172.16.0.0/16 via 192.168.179.123"]
$network_ips = [""]
}