November 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

Categories

November 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

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