- From: Arthur Kalmenson <
>
- To:
- Subject: [chef] Using not_if in bash block still causes file to be downloaded
- Date: Fri, 3 Feb 2012 10:43:32 -0500
Hello everyone,
I'm writing a recipe to install hubot using the bash resource and using the not_if constraint to avoid reinstalling each time chef-client runs. While the reinstall does not happen, I'm finding that the hubot file continues to be downloaded with wget. Therefore, the /tmp dir is filling up with hubot tar files. Is there a reason why parts of the bash block execute and others don't?
The recipe looks as follows:
...
install_dir = "#{node['hubot']['install_dir']}"
install_dir_parent = "#{node['hubot']['install_dir_parent']}"
version = "#{node['hubot']['version']}"
...
bash "install hubot" do
user hubot_user
group hubot_group
environment ({'HOME' => "#{install_dir}" })
cwd install_dir_parent
code <<-EOH
tar xzf /tmp/hubot-#{version}.tar.gz && \
cd hubot && \
npm install
EOH
not_if "#{install_dir}/bin/hubot -v 2>&1 | grep '#{version}'"
end
All the best,
--
Arthur Kalmenson
- [chef] Using not_if in bash block still causes file to be downloaded, Arthur Kalmenson, 02/03/2012
Archive powered by MHonArc 2.6.16.