Scheduling a chef-client run


#1

Is there a way to run chef-client based on some schedule of a time ?

Will push job be able to do scheduling ?


#2

Yes, and there are several ways to do this. Check out the chef-client cookbook (https://supermarket.chef.io/cookbooks/chef-client). I can do all of this for you.


#3

Suppose we need to perform patching based on some time given as Input by customer…so how can we store that time and based on that time the chef-client gets invoked?


#4

Though it has the attributes but how and where to pass and set these values in a recipe to run as a cron jobs


#5

How can i integrate this chef-client cookbook with my own cookbooks o patching so that the value we pass as a time is read and action is done accordingly.


#6

I am using a data bag item to take the value from frontend and these values from databag item is being used in a recipe.
Now the data bag item has the value of time at which the chef-client should be invoked , that too should be done remotely means chef-client will be fired from workstation and not directly on node…through knife ssh command


#7

The way I’ve done this is by getting the time to run the update from our ticketing system, so I used an API call to get that info, I suppose you could use a tag or attribute if you don’t go the API route. Then I used the the cron resource to set the schedule (time to patch) and a script that I copy over using the cookbook_file resource.

What you’re trying to do is very possible with Chef.