December 2024
M T W T F S S
 1
2345678
9101112131415
16171819202122
23242526272829
3031  

Categories

December 2024
M T W T F S S
 1
2345678
9101112131415
16171819202122
23242526272829
3031  

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 […]

chef beginner

INSPEC.IO user ‘test’ do comment ‘test user’ uid ’89’ gid ’89’ home ‘/home/random’ shell ‘/bin/bash’ action :create password ‘$1$JJsvHslasdfjVEroftprNn4JHtDi’ end user ‘test’ do comment ‘test user’ uid ’89’ gid ’89’ home ‘/home/test’ shell ‘/bin/bash’ action :create password ‘$1$/IoJI4pW$rVC197lCpPyDdkD7RxiRG/’ end user ‘test’ do comment ‘test user’ uid ’89’ gid ’89’ home ‘/home/test’ shell ‘/bin/bash’ action :modify […]