This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### definition | |
# | |
# Cookbook Name:: example | |
# Definition:: example_config_geocoders | |
# | |
define :example_config_geocoders, :geocoders_list => nil, :app_config_dir => nil do | |
app_config_dir = params[:app_config_dir] | |
geocoders_list = params[:geocoders_list] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### definition | |
# | |
# Cookbook Name:: example | |
# Definition:: example_config_geocoders | |
# | |
define :example_config_geocoders, :geocoders_list => nil, :app_config_dir => nil do | |
app_config_dir = params[:app_config_dir] | |
geocoders_list = params[:geocoders_list] | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ips = {} | |
ips[:internal] = node[:ipaddress] | |
eth = node[:network][:interfaces][:eth1][:addresses] | |
eth.each_key do |i| | |
if eth[i][:family] == "inet" | |
ips[:external] = i | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'baseline' role override_attributes: | |
21 :demo => { | |
22 :hi => { | |
23 :cow => 2 | |
24 } | |
25 } | |
'specific' role override_attribute | |
29 :demo => { | |
30 :hi => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'chef' | |
# good! | |
x = { | |
:first_level => { | |
:one => 1 | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'deep_merge' | |
# one level | |
x = { | |
:first_level => { | |
:one => 1 | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vanilla CentOS install, then go through: | |
http://wiki.opscode.com/display/chef/Installation+on+RHEL+and+CentOS+5+with+RPMs | |
Opscode chef cookbook + this patch: | |
http://github.com/mdkent/cookbooks/commit/4a7ec78dcfd53be2e9f2a37c80a3ddd411d82483 | |
With these attributes set: | |
:init_style => "init", | |
:path => "/var/lib/chef", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"run_list": [ | |
"role[baseline]", | |
"role[baseline-pvoffice]", | |
"role[chef-server]", | |
"role[chef-server-mkent]", | |
"role[baseline-runlast-cleanup]" | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cookbook/ftp_stuff/definitions/ftp_user.rb | |
define :ftp_user, :password => nil do | |
begin | |
r = resources(:template => "/etc/ftp_passwd") | |
rescue | |
r = template "/etc/ftp_passwd" do | |
owner "root" | |
group "root" | |
mode "0600" | |
cookbook "ftppasswd.erb" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ips = {} | |
ips[:internal] = node[:ipaddress] | |
if node[:network][:interfaces].include?("eth1") | |
eth = node[:network][:interfaces][:eth1][:addresses] | |
eth.each_key do |i| | |
if eth[i][:family] == "inet" | |
ips[:external] = i | |
end | |
end |
OlderNewer