May 2015
Intermediate to advanced
278 pages
5h 34m
English
You want to write cookbooks that work on different operating systems, such as Ubuntu, RedHat, Debian, or Windows.
Inside your cookbooks, you need to distinguish between these different platforms. And you need to tell your cookbook which platforms it supports. However, you don't know which platform values you can use inside metadata.rb or your recipes.
In this section, we'll look at a very simple way to ask Chef which values it defines for a platform.
Let's use plain Ruby to find out all the possible values for platform and use a subset of those in metadata.rb:
Chef::Platform class:
mma@laptop:~/chef-repo/cookbo ...Read now
Unlock full access