Skip to content

Commit

Permalink
Merge pull request #821 from rhafer/wicked-ifreload
Browse files Browse the repository at this point in the history
network: Run wicked ifreload when ifcfg files change (bsc#1011889)
  • Loading branch information
vuntz authored Nov 28, 2016
2 parents e195cba + 1d9160a commit c8f5af2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions chef/cookbooks/network/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,7 @@ def kill_nic(nic)
interfaces: ifs,
nic: nic
})
notifies :run, "bash[wicked-ifreload-#{nic.name}]", :immediately
end
if ifs[nic.name]["gateway"]
template "/etc/sysconfig/network/ifroute-#{nic.name}" do
Expand All @@ -498,12 +499,23 @@ def kill_nic(nic)
interfaces: ifs,
nic: nic
})
notifies :run, "bash[wicked-ifreload-#{nic.name}]", :immediately
end
else
file "/etc/sysconfig/network/ifroute-#{nic.name}" do
action :delete
end
end
bash "wicked-ifreload-#{nic.name}" do
action :nothing
code <<-EOF
wicked ifcheck --changed --quiet #{nic.name}
rc=$?
if [[ $rc != 0 ]]; then
wicked ifreload #{nic.name}
fi
EOF
end
end

# Avoid running the wicked related thing on SLE11 nodes
Expand Down

0 comments on commit c8f5af2

Please sign in to comment.