May 2015
Intermediate to advanced
278 pages
5h 34m
English
The Chef client enables you to run shell commands by using the execute resource. However, how can you pass arguments to such shell commands? Let's assume you want to calculate a value you need to pass to the shell command in your recipe. How can you do that? Let's find out...
Make sure you have a cookbook called my_cookbook, and the run_list of your node includes my_cookbook, as described in the Creating and using cookbooks recipe in Chapter 1, Chef Infrastructure.
Let's see how we can pass Ruby variables into shell commands:
execute resource:
mma@laptop:~/chef-repo $ subl cookbooks/my_cookbook/recipes/default.rb ...Read now
Unlock full access