[chef] Re: Chef recipe error


Chronological Thread 
  • From: Tensibai < >
  • To: < >
  • Subject: [chef] Re: Chef recipe error
  • Date: Tue, 03 Sep 2013 11:13:20 +0200

Le 2013-09-03 08:39, David Montgomery a écrit :

 


================================================================================
Error executing action `run` on resource 'execute[source_bashrc]'
================================================================================


Errno::ENOENT
-------------
No such file or directory - source /home/ubuntu/.bashrc


Resource Declaration:
---------------------
# In /home/ubuntu/workspace/Chef/chef-repo/cookbooks/bash/recipes/local.rb

 12: execute "source_bashrc" do
 13:   user "ubuntu"
 14:   command "source /home/ubuntu/.bashrc"
 15:   action :nothing
 16: end
 17:


Quite clear I think, you're trying to execute a command named source by a system call, source is a bult-in inside bash/tcsh/etc.

Change your resource to be bash.

Seen on docs.opscode.com for the execute resource:

Sourcing a file

The execute resource cannot be used to source a file (e.g. command "source filename"). The following example will fail becausesource is not an executable:

execute "foo" do
  command "source /tmp/foo.sh"
end

Instead, use the script resource or one of the script-based resources (bashcshperlpython, or ruby). For example:

bash "foo" do
  code "source /tmp/foo.sh"
end

regards,

Tensibai
 



Archive powered by MHonArc 2.6.16.

§