I have a chef cookbook which installs nginx and install a custom nginx.conf file. It’s basically the same cookbook on Opscode, and uses cookbook_file to install the file.
If I make a change to the conf file, then rerun the cookbook using chef the configuration file isn’t updated. This seems like a bug — am I doing something wrong?
In chef that the order of commands in the recipe is the order of execution. if you kept the
templatefor thenginx.confand it comes after yourcookbook_filecommand, the generated template will overwrite your file.e.g.
The
templatewould overwrite the file laid down bycookbook_file.