Merge "fix collectd break on ubuntu" into dev/experimental

This commit is contained in:
Jenkins 2014-10-06 23:51:56 +00:00 committed by Gerrit Code Review
commit 450b245efc
2 changed files with 12 additions and 4 deletions
chef/cookbooks/collectd/recipes

@ -18,13 +18,15 @@
# #
include_recipe "collectd" include_recipe "collectd"
if node["collectd"].attribute?("rhel") or node["collectd"].attribute?("debian") case node["platform_family"]
case node["platform_family"] when "rhel"
when "rhel" if node["collectd"].attribute?("rhel")
if not node["collectd"]["rhel"]["plugins"].nil? if not node["collectd"]["rhel"]["plugins"].nil?
node.override["collectd"]["plugins"]=node["collectd"]["rhel"]["plugins"].to_hash node.override["collectd"]["plugins"]=node["collectd"]["rhel"]["plugins"].to_hash
end end
when "debian" end
when "debian"
if node["collectd"].attribute?("debian")
if not node["collectd"]["debian"]["plugins"].nil? if not node["collectd"]["debian"]["plugins"].nil?
node.override["collectd"]["plugins"]=node["collectd"]["debian"]["plugins"].to_hash node.override["collectd"]["plugins"]=node["collectd"]["debian"]["plugins"].to_hash
end end

@ -31,6 +31,12 @@ when "rhel"
command "yum -y update" command "yum -y update"
action :run action :run
end end
when "debian"
execute "apt-update" do
command "apt-get update"
ignore_failure true
action :run
end
end end
node[:collectd][:package_name].each do |pkg| node[:collectd][:package_name].each do |pkg|