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
# multi instance stuff | |
if @node[:postfix_multi] | |
# loop over all multi instances and asemble templates. | |
postconf = Hash.new | |
@node[:postfix_multi].each do |instance, settings| | |
# convert postfix config into hash to merge into | |
# mult-instance config | |
h = Hash.new | |
@node[:postfix].each do |k,v| |
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
#!/usr/bin/ruby | |
require 'rubygems' | |
require 'erubis' | |
input = " | |
<% @conf.each do |k, v| -%> | |
<%= k %>=<%= v %> | |
<% 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
def generate_config | |
conf = Hash.new | |
case node[:platform] | |
when ("centos" || "redhat" || "fedora") | |
# walk the collection | |
@collection.each do |resource| | |
if resource.is_a? Chef::Resource::Route | |
# default to eth0 | |
if resource.device | |
dev = resource.device |
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
# minimal defaults for the main postfix setup | |
# by defaul postfix will be a null client setup | |
# to forward to sysmail only. | |
set[:postfix][:conf][:alias_database] = "hash:/etc/mail/aliases" | |
set[:postfix][:conf][:alias_maps] = "hash:/etc/mail/aliases" | |
set[:postfix][:conf][:html_directory] = "no" | |
set[:postfix][:conf][:inet_interfaces] = "localhost" | |
set[:postfix][:conf][:mail_owner] = "postfix" | |
set[:postfix][:conf][:mydestination] = nil |
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
package "ldirectord" do | |
action :install | |
end | |
lb = node[:heartbeat][:cluster] | |
# find all nodes that think they belong to a service | |
# | |
subscribes=Hash.new | |
search(:node, "milt_services:[* TO *]" ).each do |n| |
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
# Plugin to extend the virtualization attributes in a Xen Host | |
require_plugin 'virtualization' | |
provides 'xenserver' | |
@xe_debug=false | |
require 'pp' | |
# run std popen4 and return array of lines | |
def xe_open(cmd) | |
a = Array.new | |
puts "execute: #{cmd}" if @xe_debug |
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
#shef -z | |
... attrib stuff ... | |
/var/chef/cache/cookbooks/ohai/recipes/default.rb:20:in `from_file': undefined method `attribute?' for nil:NilClass (NoMethodError) | |
from /usr/lib/ruby/gems/1.8/gems/chef-0.9.6/lib/chef/cookbook_version.rb:316:in `load_recipe' | |
from /usr/lib/ruby/gems/1.8/gems/chef-0.9.6/lib/chef/mixin/language_include_recipe.rb:40:in `include_recipe' | |
from /usr/lib/ruby/gems/1.8/gems/chef-0.9.6/lib/chef/mixin/language_include_recipe.rb:27:in `each' | |
from /usr/lib/ruby/gems/1.8/gems/chef-0.9.6/lib/chef/mixin/language_include_recipe.rb:27:in `include_recipe' | |
from /usr/lib/ruby/gems/1.8/gems/chef-0.9.6/lib/chef/run_context.rb:93:in `load' |
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
<uby/gems/1.8/gems/chef-0.9.6/lib/chef/provider/package/yum-dump.py | grep ^chef | |
chef,installed,0,0.9.6,3.el5,noarch | |
chef-common,available,0,0.8.10,1.el5,noarch | |
chef-common,available,0,0.8.10,2.el5,noarch | |
chef-server,available,0,0.8.10,1.el5,noarch | |
chef-server,available,0,0.8.10,2.el5,noarch | |
chef-server-webui,available,0,0.8.10,1.el5,noarch | |
chef-server-webui,available,0,0.8.10,2.el5,noarch | |
chef-solr,available,0,0.8.10,1.el5,noarch | |
chef-solr,available,0,0.8.10,2.el5,noarch |
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
class Chef::Recipe | |
include Military::User | |
end | |
class Chef::Resource::User | |
include Military::User | |
end | |
wheel_members = group_members "wheel" |
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
# shef -z | |
loading configuration: /etc/chef/client.rb | |
Session type: solo | |
Loading........Session type: solo | |
Loading...............Session type: solo | |
Loading.......................Session type: solo | |
Loading..............................Session type: solo | |
Loading.......................................Session type: solo |
OlderNewer