Chef: how to add changes made using the control panel to Git?

We are currently setting up opscode chefs and we want to manage all the culinary, media, etc. through git. Is there a best practice / automation to make sure that all changes (e.g. new environments) that were made using the control panel are automatically added to version control?

+4
source share
2 answers

This exact problem is why I rarely use the web client. Instead, I have a git repository, I save the JSON configuration in a repo, and then use knife and its from file function to update nodes, roles, environments and cookbooks. It's a lot easier for me to make sure git and chef are up to date.

If you needed to use the web interface, you can configure the cron job to regularly retrieve data through the REST Chef API, and then commit any changes to your git repository.

+1
source

The solution that we developed (but did not go beyond the POC for full disclosure) is to look at couchdb for changes (http://guide.couchdb.org/draft/notifications.html) and every time the document changes, we pull it out from couchdb and check it on git.

You can either do this by constantly listening to the changes, or by creating a script, and just keep a pointer to the last updated record. This means that the solution is completely incompatible with the client, which updates the document in couchdb (that is, knife / webui / recipes / command line scripts all register their changes through the api and in couchdb)

Hope some of you bring you

+1
source

All Articles