Search code examples
chef-infracookbook

specify exact cookbook version in node run_list still possible?


I have this in my notes that {"run_list":["recipe[[email protected]]"]} is possible to explicitly specify a cookbook version to use in a nodes run_list but i can't get it to work and can't find any documentation to say if this is still supported or if it's been deprecated.

This is using chef 11.18.0. Can anyone confirm if this is still OK to use and where this should be configured. In the node run_list or role run_list ?

thanks


Solution

  • You can specify a version of a cookbook exactly as you stated. The format is recipe[cookbook_name::recipe_name@cookbook_version]. You do not need to include the recipe_name (or the ::) if you're using the default recipe.

    It works both in a role and in a runlist. You can specify it on command line when bootstrapping, add it to a node, etc.

    http://www.rubydoc.info/gems/chef/Chef/RunList/RunListItem