diff --git a/network/manifests/init.pp b/network/manifests/init.pp index f9b2d6e..7b14d24 100644 --- a/network/manifests/init.pp +++ b/network/manifests/init.pp @@ -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: {