Fixed network config updating on Ubuntu

This commit is contained in:
Ossi Salmi 2011-03-09 14:02:48 +02:00 committed by Timo Mkinen
parent 03ae395388
commit 0a11cf20aa

View file

@ -21,8 +21,8 @@ class network::helper::restart {
}
debian,ubuntu: {
exec { "restart-network":
command => "/etc/init.d/networking restart",
onlyif => "cat /etc/network/interfaces.in /etc/network/interfaces.d/*.conf > /etc/network/interfaces",
cwd => "/etc/network",
command => "cat interfaces.in interfaces.d/*.conf > interfaces && /etc/init.d/networking restart",
path => "/bin:/usr/bin:/sbin:/usr/sbin",
refreshonly => true,
}
@ -129,7 +129,7 @@ define network::interface($options = [], $ipaddr = "none", $netmask = "none", $i
}
debian,ubuntu: {
include network::helper::debian
file { "/etc/network/interfaces.d/${name}.conf":
file { "/etc/network/interfaces.d/${name}-addr.conf":
ensure => present,
content => template("network/interfaces-if.erb"),
mode => 0644,
@ -186,14 +186,14 @@ define network::route($gateway, $device) {
debian,ubuntu: {
include network::helper::restart
include network::helper::debian
file { "/etc/network/interfaces.d/${device}-gateway.conf":
file { "/etc/network/interfaces.d/${device}-gate.conf":
ensure => present,
content => template("network/interfaces-gateway.erb"),
mode => 0644,
owner => root,
group => root,
notify => Exec["restart-network"],
require => File["/etc/network/interfaces.d/${device}.conf"],
require => File["/etc/network/interfaces.d/${device}-addr.conf"],
}
}
default: {