Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

esalberg
Copy link
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
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

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

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.

None yet

3 participants