chef-client -z gets data from the file system via the chef-zero server that gets spun up on localhost:8889. the behavior you are seeing is working as designed.
you need to add a roles/was_v85_role.json file and then your run will converge.
you also don't have to pass the -j option on the command line. you might, however, want to create a separate dna.json file and invoke it with "-j dna.json" which has the same contents. the chef-zero server will then create the nodes/was_v85_node.json file and save the updated node there at the end of the run_list. if you don't want chef-zero to overwrite your json file with the updated node contents, then use "-j dna.json" instead.
On 9/18/14, 10:53 AM, Roberto Ferreira Junior wrote:
Hi,
I have tried to execute my cookbook using this command:
chef]# chef-client --local-mode -c client.rb -j nodes/was_v85_node.json -N was_v85
This is my node declaration called by the chef execution:
{"run_list":["role[was_v85_role]"]}
I have received this message:
[2014-09-18T13:14:30-04:00] INFO: Forking chef instance to converge...
Starting Chef Client, version 11.14.2
[2014-09-18T13:14:30-04:00] INFO: *** Chef 11.14.2 ***
[2014-09-18T13:14:30-04:00] INFO: Chef-client pid: 2040
[2014-09-18T13:14:33-04:00] INFO: Setting the run_list to ["role[was_v85_role]"] from CLI options
[2014-09-18T13:14:33-04:00] INFO: HTTP Request Returned 404 Not Found : Object not found: http://localhost:8889/roles/was_v85_role
================================================================================
Error expanding the run_list:
================================================================================
Unexpected API Request Failure:
-------------------------------
Object not found: http://localhost:8889/roles/was_v85_role ( I REALLY DON'T NEED THIS DATA COMING FROM THE API I JUST TO GET THE NODE FROM DE FS)
[2014-09-18T13:14:33-04:00] FATAL: Stacktrace dumped to /tmp/chef-client/chef-stacktrace.out
Chef Client failed. 0 resources updated in 3.514151 seconds
[2014-09-18T13:14:33-04:00] ERROR: 404 "Not Found "
[2014-09-18T13:14:33-04:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
I would like figure out why my role declaration inside my node isn't working
Here's my client.rb declaration:
chef]# cat client.rb
CHEF_DIR = File.expand_path(File.dirname(__FILE__))
file_cache_path "/tmp/chef-client"
role_path "/devops/commom/chef/roles"
#role_path CHEF_DIR + "/devops/commom/chef/roles"
environment_path CHEF_DIR + "/environments"
data_bag_path CHEF_DIR + "/data_bags"
cookbook_path CHEF_DIR + "/cookbooks"
ssl_client_cert CHEF_DIR + "/.ssl/client.crt"
ssl_client_key CHEF_DIR + "/.ssl/client.key"
ssl_verify_mode :verify_peer
#LOG
log_level:info
It works pretty well with chef solo, but not with "chef-client -local--mode", any suggestion?
Archive powered by MHonArc 2.6.16.