Information Technology Reference
In-Depth Information
$ more $HOME/stone.txt
Written in stone
or, for Windows Command Prompt:
> more %USERPROFILE%\stone.txt
Written in stone
Notice that chef-apply reverted the content back to Written in stone .
This is how Chef prevents configuration drift . Chef not only decides whether or not files are
created, but it also checks file content. When a file is inadvertently modified, Chef makes
sure the file reverts back to the content specified in the recipe.
The only way you can change the contents of stone.txt is by specifying different content in
the stone.rb recipe. Otherwise, chef-apply reverts the content of stone.txt back to what the
recipe specifies.
Chef decides the actions to perform to make the system configuration match what the recipe
specifies. As a Chef developer, you only need to tell Chef the desired configuration . Chef
takes care of all the rest automatically.
To Uninstall, Specify What Not to Do
You might wonder if it is possible to get Chef to automatically uninstall everything it installs.
Not quite, but you can perform the equivalent of an uninstallation by telling Chef explicitly
what not to do.
This might seem like Chef falls short in the uninstallation department, but that's not the case.
Remember, Chef tries to be smart. You don't need to tell Chef how to do something. Instead
you define the desired configuration you want in a recipe, and Chef determines what to do.
Your recipe tells Chef when to stop reasoning about the configuration of the machine by de-
fining what the desired configuration looks like.
There is no reasonable way for Chef to automatically reverse changes or uninstall and ensure
that a system will consistently be in a known good configuration. You probably already
know this is an impossible problem to solve in general. Every system administrator has come
to the point in troubleshooting an issue caused by unknown changes to a computer where he
gives up, wipes the box, and starts over again from scratch.
Search WWH ::




Custom Search