puppet-network
puppet-network copied to clipboard
Enable using ifscripts for alias resources; allow setting ifcfg resources to absent (remove file)
Create a parameter to allow using the ifup / ifdown scripts for alias resources only (less disruptive than a full network restart). Allow removal of ifcfg file for aliases when ensure is set to absent.
I have a branch that combines both restarts and ifscripts into one, if that would be helpful. I didn't know if you'd want the functionality split into two PRs.
I had to replace the following code to make it work on my setup. in centos7 the ":" is replaced by "_" in interfaces fact.
--- a/modules/network/manifests/init.pp
+++ b/modules/network/manifests/init.pp
@@ -205,7 +205,7 @@ define network_if_base (
}
if $ifscripts {
- if ! ($interface in $::interfaces) {
+ if ! (regsubst($interface, ':', '_') in $::interfaces) {
$refreshonly_ifscripts = undef
}
else {
In my case puppet doesn't replace ':' by '_' in $::interfaces. So should be safe have both conditions like:
--- a/modules/network/manifests/init.pp +++ b/modules/network/manifests/init.pp @@ -205,7 +205,7 @@ define network_if_base ( }
if $ifscripts {
- if ! (regsubst($interface, ':', '_') in $::interfaces) {
- if ! ((regsubst($interface, ':', '_') in $::interfaces) or ($interface in $::interfaces)){ $refreshonly_ifscripts = undef } else {