Hi,I am running a for loop to create 2 directories and then install tomcat in those directoriesBut the notify resource i run it goes and look for 2nd directory all the time not the first one ,i am not sure what i am doing wrong , looks like the notify resource is always running and picking the last attribute.please advise, may be i am doing something very stupid.here is the piece of codenode['tcat']['base_dir'].each do |base_name|directory "#{base_name}" doowner "deploy"group "deploy"mode 00755action :createendcookbook_file "#{base_name}/tomcat.tar" dosource "tomcat.tar"mode 0777owner "deploy"group "deploy"notifies :run, "bash[install_tomcat]", :immediatelyendbash "install_tomcat" docode <<-EOSset -epwdecho "base name is #{base_name}"tar -xvf "#{base_name}/tomcat.tar -C #{base_name}"EOSaction :nothingendthis is the attributes :default[:tcat][:base_dir]=['/local_app/tc1','/local_app/tc2']Here is the error log :[2013-10-21T13:58:16-07:00] INFO: Processing directory[/local_app/tc1] action create (base_tomcat::default line 13)[2013-10-21T13:58:16-07:00] INFO: directory[/local_app/tc1] created directory /local_app/tc1[2013-10-21T13:58:16-07:00] INFO: directory[/local_app/tc1] owner changed to 101[2013-10-21T13:58:16-07:00] INFO: directory[/local_app/tc1] group changed to 57001[2013-10-21T13:58:16-07:00] INFO: directory[/local_app/tc1] mode changed to 755[2013-10-21T13:58:16-07:00] INFO: Processing cookbook_file[/local_app/tc1/tomcat.tar] action create (base_tomcat::default line 19)[2013-10-21T13:58:16-07:00] INFO: cookbook_file[/local_app/tc1/tomcat.tar] owner changed to 101[2013-10-21T13:58:16-07:00] INFO: cookbook_file[/local_app/tc1/tomcat.tar] group changed to 57001[2013-10-21T13:58:16-07:00] INFO: cookbook_file[/local_app/tc1/tomcat.tar] mode changed to 777[2013-10-21T13:58:16-07:00] INFO: cookbook_file[/local_app/tc1/tomcat.tar] created file /local_app/tc1/tomcat.tar[2013-10-21T13:58:16-07:00] INFO: cookbook_file[/local_app/tc1/tomcat.tar] sending run action to bash[install_tomcat] (immediate)[2013-10-21T13:58:16-07:00] INFO: Processing bash[install_tomcat] action run (base_tomcat::default line 27)^[[0m================================================================================^[[0m^[[31mError executing action `run` on resource 'bash[install_tomcat]'^[[0m================================================================================^[[0m^[[0mMixlib::ShellOut::ShellCommandFailed^[[0m------------------------------------^[[0mExpected process to exit with [0], but received '2'---- Begin output of "bash" "/tmp/chef-script20131021-29471-4yisj8" ----STDOUT: /base name is /local_app/tc2STDERR: tar: /local_app/tc2/tomcat.tar -C /local_app/tc2: Cannot open: No such file or directorytar: Error is not recoverable: exiting now---- End output of "bash" "/tmp/chef-script20131021-29471-4yisj8" ----Ran "bash" "/tmp/chef-script20131021-29471-4yisj8" returned 2^[[0m^[[0mResource Declaration:^[[0m---------------------^[[0m# In /var/chef/cache/cookbooks/base_tomcat/recipes/default.rb
Archive powered by MHonArc 2.6.16.