Arvind Purohith
Arvind Purohith

Reputation: 41

How to rerun a recipe when something is changed in data bag without logging in to chef-client machine

I have a chef-client machine in which recipe accesses data bag values. I need to rerun the chef-recipe on client machine without logging into the machine. Is their a way to rerun the recipe when their is some change to data bag.

Upvotes: 0

Views: 373

Answers (2)

fat rabbit
fat rabbit

Reputation: 25

To me this is a pretty custom solution. You can use SQS, SNI to AWS to achieve that. So every time when you change database you can send message with SNI and after that your node will receive notification and will run chef-client on localhost.

Upvotes: 0

Mr.
Mr.

Reputation: 10102

no, you must trigger chef-client either by logging into the machine and execute chef-client or by setting a periodic task (cron) which will execute chef-client for you.

idempotence (and convergance) is a main concept in chef:

Every resource has its own set of actions and properties. Most properties have default values. Some properties are available to all resources, for example those used to send notifications to other resources and guards that help ensure that some resources are idempotent.

thus, if you wrote your cookbook correctly, only the changes will be applied when you execute chef-client

Upvotes: 1

Related Questions