18

I have this in my notes that {"run_list":["recipe[nginx@1.2.3]"]} 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

Jay Prall
  • 5,295
  • 5
  • 49
  • 79
Flo Woo
  • 949
  • 1
  • 12
  • 26
  • Here is the issue and commit that removed the documentation: https://github.com/chef/chef-web-docs-2016/issues/574 – TwistedTech Jul 19 '16 at 16:15

1 Answers1

31

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

StephenKing
  • 36,187
  • 11
  • 83
  • 112
w25r
  • 882
  • 10
  • 15
  • How can I change this via the Web Management GUI of the chef server? I use the chef-client recipe. In the selection window with the drag+drop fields, I don't see where I can specify the version – dfsg76 Nov 14 '17 at 09:15