X-Git-Url: https://git.openstreetmap.org/chef.git/blobdiff_plain/0a97a0dc8db53359fee0af041c4608a212b0c30f..e5f294d3dc676675b2803915571c28337468c3b3:/cookbooks/munin/recipes/default.rb diff --git a/cookbooks/munin/recipes/default.rb b/cookbooks/munin/recipes/default.rb index 1b4ae6d75..0fddea5a9 100644 --- a/cookbooks/munin/recipes/default.rb +++ b/cookbooks/munin/recipes/default.rb @@ -20,11 +20,6 @@ package "munin-node" service "munin-node" do - if node[:lsb][:release].to_f >= 15.10 - provider Chef::Provider::Service::Systemd - elsif node[:lsb][:release].to_f >= 14.04 - provider Chef::Provider::Service::Upstart - end action [:enable, :start] supports :status => true, :restart => true, :reload => true end @@ -97,7 +92,7 @@ else end munin_plugin_conf "df" do - template "df.erb" + template_source "df.erb" end munin_plugin "df" @@ -162,9 +157,11 @@ end node[:network][:interfaces].each do |ifname, ifattr| if ifattr[:encapsulation] == "Ethernet" && ifattr[:state] == "up" - if node[:hardware] && node[:hardware][:network][ifname][:device] =~ /^virtio/ + if node[:hardware] && + node[:hardware][:network] && + node[:hardware][:network][ifname][:device] =~ /^virtio/ munin_plugin_conf "if_#{ifname}" do - template "if.erb" + template_source "if.erb" variables :ifname => ifname end else @@ -210,11 +207,10 @@ if Dir.glob("/dev/ipmi*").empty? munin_plugin "ipmi_power" do action :delete - only_if { node[:lsb][:release].to_f >= 14.04 } end else munin_plugin_conf "ipmi" do - template "ipmi.erb" + template_source "ipmi.erb" end munin_plugin "ipmi_fans" do @@ -227,7 +223,6 @@ else munin_plugin "ipmi_power" do target "ipmi_" - only_if { node[:lsb][:release].to_f >= 14.04 } end end