March 2017
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  

Categories

March 2017
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  

for loops in Chef

for config in [ “contacts.cfg”, “contactgroups.cfg” ] do remote_file “/etc/nagios3/#{config}” do source “#{config}” owner “root” group “root” mode 0644 notifies :restart, resources(:service => “nagios”), :delayed end end Write it in the order you want it to run

Chef executes resources in the order they appear in a recipe. Coming to Chef from Puppet, I found […]

BERKSHELF

BERKSHELF

Manage a Cookbook or an Application’s Cookbook dependencies

$ gem install berkshelf Successfully installed berkshelf-2.0.0 1 gem installed

Specify your dependencies in a Berksfile in your cookbook’s root

site :opscode cookbook ‘mysql’ cookbook ‘nginx’, ‘~> 0.101.5’

Install the cookbooks you specified in the Berksfile and their dependencies

$ berks install

Add the […]