[chef] Chef recipe error

Chronological Thread 
  • From: David Montgomery < >
  • To:
  • Subject: [chef] Chef recipe error
  • Date: Tue, 3 Sep 2013 14:39:26 +0800


Rather dumfounded on why I get an error with this recipe.....The file is there.  Why does chef complain that it is not?  This should be so simple....a template changes then source my .bashrc file.

:~$ ls /home/ubuntu/.bash_includes

execute "add_include_to_bashrc" do
  user "ubuntu"
  command "echo 'source /home/ubuntu/.bash_includes' | tee -a /home/ubuntu/.bashrc"
  action :run
  ignore_failure true
  not_if {File.exists?("/home/ubuntu/.bash_includes")}

execute "source_bashrc" do
  user "ubuntu"
  command "source /home/ubuntu/.bashrc"
  action :nothing

template "/home/ubuntu/.bash_includes" do
  path "/home/ubuntu/.bash_includes"
  source "bash_includes.erb"
  owner "ubuntu"
  group "ubuntu"
  mode "0770"
  notifies :run, "execute[source_bashrc]", :immediately

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

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

Compiled Resource:
# Declared in /home/ubuntu/workspace/Chef/chef-repo/cookbooks/bash/recipes/local.rb:12:in `from_file'

execute("source_bashrc") do
  action [:nothing]
  retries 0
  retry_delay 2
  command "source /home/ubuntu/.bashrc"
  backup 5
  returns 0
  user "ubuntu"
  cookbook_name :bash
  recipe_name "local"

Archive powered by MHonArc 2.6.16.