Reputation: 16152
I'm using chef solo with the following files.
node.json
{
"run_list": [
"recipe[testing]"
]
}
solo.rb
file_cache_path "/home/vagrant/chef"
cookbook_path "/home/vagrant/chef/cookbooks"
json_attribs "/home/vagrant/chef/node.json"
execute "testing" do
command "echo hello"
end
Why doesn't the echo hello
part of the solo.rb run? Is it possible to run ad-hoc commands within solo.rb?
Or should solo.rb only be used to specify the path of node.json which would include a recipe for the ad-hoc command. I'm trying to avoid creating a recipe for just a simple one-off command.
Upvotes: 0
Views: 1073
Reputation: 26997
You can read more about the solo.rb config file, but that is the config file for Chef Solo - you cannot execute recipe code inside that config file. If you want to execute a Chef recipe, you can add it to the run_list in the JSON file.
Upvotes: 0