Chef Infrastructure Automation Cookbook Second Edition by Marschall Matthias

Chef Infrastructure Automation Cookbook Second Edition by Marschall Matthias

Author:Marschall, Matthias
Language: eng
Format: epub
Publisher: Packt Publishing
Published: 2015-05-28T16:00:00+00:00


There's more...

The execute resource offers a way to pass environment variables to the command it executes.

Change the my_cookbook default recipe: mma@laptop:~/chef-repo $ subl cookbooks/my_cookbook/recipes/default.rb

execute 'print value of environment variable $MESSAGE' do command 'echo $MESSAGE > /tmp/message' environment 'MESSAGE' => 'Hello from the execute resource' end

Upload the modified cookbook to your Chef server and run the Chef client, as shown in the How to do it... section.

Validate the contents of the tmp file: user@server:~$ cat /tmp/message



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.