Run apt-get update before installing log related packages

ubuntu has an old apt cache upon a fresh installation, so some
package may not be in the cache yet because I noticed some dstat
installation failures due to no condidate found, so run apt-get update
first before installing packages.

Change-Id: I02cc51c45ab65a8eb9c915a87fad28aa4d844acb
This commit is contained in:
Jerry Zhao 2014-06-13 18:00:32 +00:00
parent c959d5eedc
commit 55eb597788
2 changed files with 10 additions and 2 deletions
chef/cookbooks/rsyslog/recipes

@ -25,7 +25,7 @@ package "dstat" do
end
execute "dstat" do
command "dstat -tcmndp --top-cpu --freespace >>/var/log/dstat.log &"
command "dstat -tcmndp --top-cpu >>/var/log/dstat.log &"
action :run
end
@ -129,7 +129,7 @@ template "/etc/rsyslog.d/sysstat.conf" do
group "root"
mode 0644
variables :loglist => node['rsyslog']['sysstatlog']
notifies :restart, "service[rsyslog]"
notifies :restart, "service[rsyslog]", :immediately
end
file "/etc/rsyslog.d/server.conf" do

@ -29,6 +29,14 @@ if platform?("ubuntu") && node['platform_version'].to_f == 8.04
end
end
if platform?("ubuntu")
execute "apt-get-update" do
command "apt-get update"
ignore_failure true
action :run
end
end
package "rsyslog" do
action :install
end