[chef] Re: Invisible Guard stopping exeution


Chronological Thread 
  • From: Christopher Hahn < >
  • To: Vina Rakotondrainibe < >,
  • Subject: [chef] Re: Invisible Guard stopping exeution
  • Date: Wed, 12 Nov 2014 09:35:57 -0800

Thank you for the time!

I am very new to Chef and will have to think about the notify idea...
...I suspected that the file was being processed from the top down, I am sure.

Now, as to the directory, I will look that one up...I thought that the "action :create"
would cause the dir to be created.

I am banging on!  All comments appreciated!

Christopher


On Wed, Nov 12, 2014 at 9:26 AM, Vina Rakotondrainibe < " target="_blank"> > wrote:

Hi,

Maybe I am getting this wrong but the cookbook_file statement should notify the unzip task right?

Also you should create the dest_dir to make sure the unzip does not fail when it is notified.

Cheers,
Vina

Le 12 nov. 2014 17:12, Christopher Hahn < " target="_blank"> > a écrit :
Hello,

This small recipe:
##############################################
include_recipe 'nodejs'

service_name = node[:prod][:service]
dest_dir = "/opt/#{service_name}"

cookbook_file "PROD" do
  source "prod.zip"
  mode   "0644"
  path "/tmp/prod.zip"
end

directory dest_dir do
  owner  'root'
  group  'root'
  mode "0755"
  recursive true
  action :create
end

execute "extract from ZIP" do
  cwd dest_dir
  command "unzip prod.zip"
  action :run
  #notifies :run, "execute[start]", :immediately
end
##############################################


...keeps skipping the extraction of the zipfile:
##############################################
[2014-11-12T10:55:18-05:00] INFO: Processing cookbook_file[PROD] action create (prod::default line 15)
[2014-11-12T10:55:19-05:00] INFO: Processing directory[/opt/prod] action create (prod::default line 21)
[2014-11-12T10:55:19-05:00] INFO: Processing execute[extract from ZIP] action run (prod::default line 29)
[2014-11-12T10:55:19-05:00] DEBUG: Skipping execute[extract from ZIP] due to only_if ruby block
[2014-11-12T10:55:19-05:00] INFO: Chef Run complete in 20.776709674 seconds
##############################################

...but I have no only_if guard in place?

Too new to complain. :0)

Christopher



  • [chef] Re: Invisible Guard stopping exeution, Christopher Hahn, 11/12/2014

Archive powered by MHonArc 2.6.16.

§