Skip to content

Enable using ifscripts for alias resources; allow setting ifcfg resources to absent (remove file)#133

Open
esalberg wants to merge 1 commit intorazorsedge:developfrom
esalberg:ifscripts
Open

Enable using ifscripts for alias resources; allow setting ifcfg resources to absent (remove file)#133
esalberg wants to merge 1 commit intorazorsedge:developfrom
esalberg:ifscripts

Conversation

@esalberg
Copy link
Copy Markdown
Contributor

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.

@esalberg
Copy link
Copy Markdown
Contributor Author

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.

@jsfrerot
Copy link
Copy Markdown

jsfrerot commented Mar 28, 2018

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 {

@cropalato
Copy link
Copy Markdown

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 {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants