metadata.rb

metadata.rb

Every cookbook requires a small amount of metadata. A file named metadata.rb is located at the top of every cookbook directory structure. The contents of the metadata.rb file provides hints to the Chef server to help ensure that cookbooks are deployed to each node correctly.

A metadata.rb file is:

  • Located at the top level of a cookbook’s directory structure
  • Compiled whenever a cookbook is uploaded to the Chef server or when the knife cookbook metadata subcommand is run, and then stored as JSON data
  • Created automatically by knife whenever the knife cookbook create subcommand is run
  • Edited using a text editor, and then re-uploaded to the Chef server as part of a cookbook upload

Note

A metadata.json file can be edited d