April 2024
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
2930  

Categories

April 2024
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
2930  

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