Question

This is a super basic task, but I can't find documentation on it. I am booting EC2 machines using a chef-server and chef. If that fails i would like to fix the recipes and then reinstall the role and recipes on that machine without taking the node out and creating it again. I cannot find the command that does that.

If I run chef-client on the machine I get:

chef-client
[Wed, 18 Jan 2012 11:23:58 +0000] INFO: *** Chef 0.10.0 ***
[Wed, 18 Jan 2012 11:23:59 +0000] INFO: Run List is []
[Wed, 18 Jan 2012 11:23:59 +0000] INFO: Run List expands to []
[Wed, 18 Jan 2012 11:23:59 +0000] INFO: Starting Chef Run for gidsy-staging-web
[Wed, 18 Jan 2012 11:23:59 +0000] INFO: Loading cookbooks []
[Wed, 18 Jan 2012 11:23:59 +0000] WARN: Node gidsy-staging-web has an empty run list.
[Wed, 18 Jan 2012 11:23:59 +0000] INFO: Chef Run complete in 0.508629 seconds
[Wed, 18 Jan 2012 11:23:59 +0000] INFO: Running report handlers
[Wed, 18 Jan 2012 11:23:59 +0000] INFO: Report handlers complete

Thanks

Was it helpful?

Solution

I have encountered the same issue and this is how I have resolved the issue.

First, I apply the role(s) in question to the instance using knife:

$ knife node run_list add [NODE] [ENTRY]

Be sure and include the items in [ENTRY] in quotes (for example, "role[my-role]").

Once the role has been applied to the EC2 instance, I then invoke chef-client on the instance in question.

$ sudo chef-client

This should speed up your development cycle substantially.

OTHER TIPS

Jordan's answer really helped me out but for those who are starting chef like me I will explain in a bit more detail.

I am running on EC2 and was getting the above error. This is what I did to resolve it:

  1. On my local machine, run: knife ec2 server list to get the host node on the EC2 server
  2. Add the run list to that node from my local dev machine: knife node run_list add i-xxxxx "role[aws-db-deploy]" where i-xxxxx is your node name
  3. ssh onto your aws ec2 instance and run the command: sudo chef-client

Hope this helps

You can run the chef-client with the runlist:

$ sudo chef-client --runlist <role>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top