[chef] Template variable for which recipe and template a file was expanded from


Chronological Thread 
  • From: William McVey < >
  • To:
  • Subject: [chef] Template variable for which recipe and template a file was expanded from
  • Date: Tue, 31 Jul 2012 18:20:15 -0400

I'd like to put a notice in the config files managed by chef to inform other sysadmins that a particular file is under Chef management and to not make ad-hoc changes. This isn't so important on "production" machines, as it's understood that those machines have procedures associated with making changes, but especially as test, prototype, and even dev machines are folded into Chef management, putting in a notice that says "This file originated from Chef recipe: COOKBOOK_NAME::RECIPE_NAME from the template file XYZ.erb" would be useful. I was wondering if there was already a facility for these variables that might already be passed to the template engine, and if not, if there was a convenient way to add them across all templates without having to hack them into every template resource.

  -- William



Archive powered by MHonArc 2.6.16.

§