A keep file gives you the flexibility to modify configuration settings in specific files within the /data and /etc directories of your EBS (Amazon Elastic Block Storage) volume.
When Engine Yard’s Chef goes to create configuration files from its recipe templates, it checks the filesystem for certain files prefaced with keep. If such files exist, then the Chef recipe doesn’t create new configuration files; instead it leaves the keep files in place.
For example, if the template is about to write out a configuration file called /data/myservice.conf, Chef first looks for /data/keep.myservice.conf. If this file is found, then Chef skips writing out the template-base configuration file. And, the keep.myservice.conf file is used instead.
Files that can be keep files
These are the files that can be made into keep files.
Note: Only this subset of files in the /etc or /data directories can be made into keep files. Other files in these directories might be overwritten or ignored even if they have been prefaced with “keep”.
Important! Risks associated with keep files
There are risks associated with keep files. Use keep files with caution.
Making a keep file effectively “freezes” the file. If your environment changes, either through changes that you apply yourself or when you upgrade to the latest Engine Yard stack, your keep files can become out-of-date and thus compromise your application.
Before making changes to a production environment, review your keep files.
Tip: Where possible, consider using an include file instead of a keep file.
To use keep files for configuration
Connect to your instance via SSH.
Edit the file and rename (to keep.filename.extension) any of the files listed above.
For example, for an application name “myapp”, configure the nginx server by renaming /data/nginx/servers/myapp.conf to /data/nginx/servers/keep.myapp.conf
If you make nginx.conf or database.yml into keep files, add a deploy hook to create a symlink.