Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reload chef recipes if install fails or updates are available

Tags:

chef-infra

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

like image 453
Philipp Wassibauer Avatar asked Jan 18 '12 11:01

Philipp Wassibauer


1 Answers

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.

like image 172
Jordan Dea-Mattson Avatar answered Sep 28 '22 04:09

Jordan Dea-Mattson