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
node[:network][:interfaces].each do |ifname, ifattr|
if ifattr[:encapsulation] == "Ethernet" && ifattr[:state] == "up"
- if 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"
variables :ifname => ifname
munin_plugin "ipmi_power" do
action :delete
- only_if { node[:lsb][:release].to_f >= 14.04 }
end
else
munin_plugin_conf "ipmi" do
munin_plugin "ipmi_power" do
target "ipmi_"
- only_if { node[:lsb][:release].to_f >= 14.04 }
end
end