Skip to content

Commit

Permalink
remove passenger support from rails recipe. update versions. add kvm,…
Browse files Browse the repository at this point in the history
… dhcpd, nagios plugins, fcgiwrap.
  • Loading branch information
jsierles2 committed May 4, 2010
1 parent 29308b0 commit 01c7a94
Show file tree
Hide file tree
Showing 101 changed files with 7,468 additions and 379 deletions.
2 changes: 1 addition & 1 deletion apache2/attributes/apache.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
default.apache[:user] = "www-data"
default.apache[:binary] = "/usr/sbin/apache2"
default.apache[:icondir] = "/usr/share/apache2/icons"
default.apache[:version] = "2.2.9-7ubuntu3.5"
default.apache[:version] = "2.2.12-1ubuntu2"

default.apache[:listen_ports] = ["80"]
default.apache[:contact] = "[email protected]"
Expand Down
2 changes: 1 addition & 1 deletion apache2/recipes/default.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package "apache2" do
name "apache2"
version node[:apache][:version]
#version node[:apache][:version]
end

service "apache2" do
Expand Down
2 changes: 1 addition & 1 deletion apt/attributes/mirror.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
default.apt[:mirror][:base_path] = "/u/mirrors/apt"

default.apache[:sites][:dist][:server_name] = "dist.#{domain}"
#default.apache[:sites][:dist][:server_name] = "dist.#{domain}"
default.apache[:sites][:dist][:server_alias] = "dist"
default.apache[:sites][:dist][:document_root] = "/u/mirrors/dist"
default.apache[:sites][:dist][:error_log] = "/var/log/apache2/dist_error.log"
Expand Down
28 changes: 4 additions & 24 deletions apt/recipes/default.rb
Original file line number Diff line number Diff line change
@@ -1,33 +1,13 @@
remote_file "/etc/apt/packages.gpg" do
source "packages.gpg"
owner "root"
group "root"
mode 0644
end

remote_file "/etc/apt/sources.list" do
source "sources.list.#{node[:domain].split(".").first}"
owner "root"
group "root"
mode 0644
not_if { node[:domain] == 'localdomain' || node[:domain] == 'ubuntu' }
end

%w{/var/cache/local /var/cache/local/preseeding}.each do |dirname|
directory dirname do
if @node[:datacenter]
remote_file "/etc/apt/sources.list" do
source "sources.list.#{@node[:datacenter]}"
owner "root"
group "root"
mode 0644
action :create
mode 00644
end
end

execute "apt-key-add" do
command "/usr/bin/apt-key add /etc/apt/packages.gpg"
only_if "test `/usr/bin/apt-key list | grep -c [email protected]` -eq 0"
end

execute "apt-get-update" do
command "apt-get update"
end

5 changes: 4 additions & 1 deletion apt/recipes/packages.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@

require_recipe 'apt'

if node[:packages]
node[:packages].each do |group, packages|
Chef::Log.info "Installing packages for package group, #{group}"
Expand All @@ -7,4 +10,4 @@
end
end
end
end
end
4 changes: 2 additions & 2 deletions bluepill/attributes/bluepill.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
default.bluepill[:bin] = languages[:ruby][:bin_dir] + "/bluepill"
default.bluepill[:bin] = node[:languages][:ruby][:bin_dir] + "/bluepill"
default.bluepill[:config_dir] = "/etc/bluepill"
default.bluepill[:log_dir] = "/var/log/bluepill"
default.bluepill[:pid_dir] = "/var/run/bluepill"
bluepill[:version] = "0.0.37"
bluepill[:version] = "0.0.37"
2 changes: 1 addition & 1 deletion bundler/attributes/bundler.rb
Original file line number Diff line number Diff line change
@@ -1 +1 @@
set[:bundler][:version] = '0.9.13'
set[:bundler][:version] = '0.9.24'
2 changes: 1 addition & 1 deletion chef/attributes/client.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
default.chef[:client_version] = "0.8.10"
default.chef[:client_version] = "0.8.11"
default.chef[:client_path] = `which chef-client`.chomp
default.chef[:client_interval] = "300"
default.chef[:client_splay] = "20"
Expand Down
10 changes: 5 additions & 5 deletions chef/attributes/server.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
default.chef[:server_version] = "0.8.10"
default.chef[:server_path] = "#{languages[:ruby][:gems_dir]}/gems/chef-server-#{chef[:server_version]}"
default.chef[:server_api_path] = "#{languages[:ruby][:gems_dir]}/gems/chef-server-api-#{chef[:server_version]}"
default.chef[:server_webui_path] = "#{languages[:ruby][:gems_dir]}/gems/chef-server-webui-#{chef[:server_version]}"
default.chef[:webui_default_password] = '7bc318032e'
default.chef[:server_version] = "0.8.11"
default.chef[:server_path] = "#{node[:languages][:ruby][:gems_dir]}/gems/chef-server-#{chef[:server_version]}"
default.chef[:server_api_path] = "#{node[:languages][:ruby][:gems_dir]}/gems/chef-server-api-#{chef[:server_version]}"
default.chef[:server_webui_path] = "#{node[:languages][:ruby][:gems_dir]}/gems/chef-server-webui-#{chef[:server_version]}"
default.chef[:webui_default_password] = '7bc318032e'
2 changes: 1 addition & 1 deletion chef/templates/default/sv-chef-client-run.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
PATH=/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin<% if @node[:languages][:ruby][:gems_dir] %>:<%= @node[:languages][:ruby][:gems_dir] %>/bin<% end -%>
exec 2>&1
exec /usr/bin/env chef-client -i <%= @node[:bootstrap][:chef][:client_interval] %> -s <%= @node[:bootstrap][:chef][:client_splay] %> <% if @node[:bootstrap][:chef][:client_log] != "STDOUT" then -%>-L <%= @node[:bootstrap][:chef][:client_log] %><% end -%>
exec /usr/bin/env chef-client -i <%= @node[:chef][:client_interval] %> -s <%= @node[:chef][:client_splay] %> <% if @node[:chef][:client_log] != "STDOUT" then -%>-L <%= @node[:chef][:client_log] %><% end -%>
40 changes: 26 additions & 14 deletions dell_omsa/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,46 @@
package "ipmitool"
package "rpm"

service "dataeng" do
name "dataeng"
supports :restart => true, :reload => false
remote_file "/tmp/dellomsa_5.5.0-5_amd64.deb" do
source "http://chef.sc-chi-int.37signals.com/dellomsa_5.5.0-5_amd64.deb"
not_if { File.exists?("/tmp/dellomsa_5.5.0-5_amd64.deb")}
end

service "dsm_om_connsvc" do
name "dsm_om_connsvc"
dpkg_package "dellomsa_5.5.0-5" do
source "/tmp/dellomsa_5.5.0-5_amd64.deb"
end

service "dataeng" do
name "dataeng"
supports :restart => true, :reload => false
action :enable
end

execute "ldconfig" do
command "ldconfig"
action :nothing
notifies :restart, resources(:service => "dataeng")
notifies :restart, resources(:service => "dsm_om_connsvc")
end

remote_file "/tmp/dellomsa_5.5.0-5_amd64.deb" do
source "http://chef.sc-chi-int.37signals.com/dellomsa_5.5.0-5_amd64.deb"
not_if { File.exists?("/tmp/dellomsa_5.5.0-5_amd64.deb")}
service "dsm_om_connsvc" do
name "dsm_om_connsvc"
supports :restart => true, :reload => false
action [ :disable, :stop ]
end

dpkg_package "dellomsa_5.5.0-5" do
source "/tmp/dellomsa_5.5.0-5_amd64.deb"
notifies :run, resources(:execute => "ldconfig")
service "dsm_sa_ipmi" do
name "dsm_sa_ipmi"
supports :restart => true, :reload => false
action [ :disable, :stop ]
end

#fixing webui login issues
service "dsm_om_shrsvc" do
name "dsm_om_shrsvc"
supports :restart => true, :reload => false
action [ :disable, :stop ]
end

# fixing webui login issues
remote_file "/lib32/security/pam_nologin.so" do
source "pam_nologin.so"
mode 0755
Expand All @@ -46,4 +58,4 @@
owner "root"
group "root"
notifies :run, resources(:execute => "ldconfig")
end
end
4 changes: 4 additions & 0 deletions dhcpd/attributes/dhcpd.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
default.dhcpd[:interfaces] = [ 'eth0' ]
default.dhcpd[:tftp_server] = "10.0.0.1"
default.dhcpd[:gateway] = "10.0.0.1"
default.dhcpd[:netmask] = "255.255.255.0"
4 changes: 4 additions & 0 deletions dhcpd/metadata.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
maintainer "37signals"
maintainer_email "[email protected]"
description "Configures DHCP Daemon"
version "0.1"
20 changes: 20 additions & 0 deletions dhcpd/recipes/default.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#
# Cookbook Name:: dhcpd
# Recipe:: default
#
# Copyright 2010, 37signals
#
# All rights reserved - Do Not Redistribute
#

package "dhcp3-server"
service "dhcp3-server"

template "/etc/default/dhcp3-server" do
source "dhcp3-server.default.erb"
owner "root"
group "root"
mode 0644
notifies(:restart, resources(:service => "dhcp3-server"))
end

11 changes: 11 additions & 0 deletions dhcpd/templates/default/dhcp3-server.default.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Defaults for dhcp initscript
# sourced by /etc/init.d/dhcp
# installed at /etc/default/dhcp3-server by the maintainer scripts

#
# This is a POSIX shell fragment
#

# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
# Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACES="<%= @node[:dhcpd][:interfaces ].join(' ') %>"
128 changes: 128 additions & 0 deletions dhcpd/templates/default/dhcpd.conf.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
#
# Sample configuration file for ISC dhcpd for Debian
#
# Attention: If /etc/ltsp/dhcpd.conf exists, that will be used as
# configuration file instead of this file.
#
# $Id: dhcpd.conf,v 1.1.1.1 2002/05/21 00:07:44 peloy Exp $
#

# The ddns-updates-style parameter controls whether or not the server will
# attempt to do a DNS update when a lease is confirmed. We default to the
# behavior of the version 2 packages ('none', since DHCP v2 didn't
# have support for DDNS.)
ddns-update-style none;

# option definitions common to all supported networks...
option domain-name "<%= node[:domain] %>";
option domain-name-servers <%= node[:nameservers].join(',') %>

default-lease-time 600;
max-lease-time 7200;

# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
#authoritative;

# Use this to send dhcp log messages to a different log file (you also
# have to hack syslog.conf to complete the redirection).
log-facility local7;

# No service will be given on this subnet, but declaring it helps the
# DHCP server to understand the network topology.

#subnet 10.152.187.0 netmask 255.255.255.0 {
#}

# This is a very basic subnet declaration.

#subnet 10.254.239.0 netmask 255.255.255.224 {
# range 10.254.239.10 10.254.239.20;
# option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org;
#}

# This declaration allows BOOTP clients to get dynamic addresses,
# which we don't really recommend.

#subnet 10.254.239.32 netmask 255.255.255.224 {
# range dynamic-bootp 10.254.239.40 10.254.239.60;
# option broadcast-address 10.254.239.31;
# option routers rtr-239-32-1.example.org;
#}

# A slightly different configuration for an internal subnet.
#subnet 10.5.5.0 netmask 255.255.255.224 {
# range 10.5.5.26 10.5.5.30;
# option domain-name-servers ns1.internal.example.org;
# option domain-name "internal.example.org";
# option routers 10.5.5.1;
# option broadcast-address 10.5.5.31;
# default-lease-time 600;
# max-lease-time 7200;
#}

# Hosts which require special configuration options can be listed in
# host statements. If no address is specified, the address will be
# allocated dynamically (if possible), but the host-specific information
# will still come from the host declaration.

#host passacaglia {
# hardware ethernet 0:0:c0:5d:bd:95;
# filename "vmunix.passacaglia";
# server-name "toccata.fugue.com";
#}

# Fixed IP addresses can also be specified for hosts. These addresses
# should not also be listed as being available for dynamic assignment.
# Hosts for which fixed IP addresses have been specified can boot using
# BOOTP or DHCP. Hosts for which no fixed address is specified can only
# be booted with DHCP, unless there is an address range on the subnet
# to which a BOOTP client is connected which has the dynamic-bootp flag
# set.
#host fantasia {
# hardware ethernet 08:00:07:26:c0:a5;
# fixed-address fantasia.fugue.com;
#}

# You can declare a class of clients and then do address allocation
# based on that. The example below shows a case where all clients
# in a certain class get addresses on the 10.17.224/24 subnet, and all
# other clients get addresses on the 10.0.29/24 subnet.

#class "foo" {
# match if substring (option vendor-class-identifier, 0, 4) = "SUNW";
#}

#shared-network 224-29 {
# subnet 10.17.224.0 netmask 255.255.255.0 {
# option routers rtr-224.example.org;
# }
# subnet 10.0.29.0 netmask 255.255.255.0 {
# option routers rtr-29.example.org;
# }
# pool {
# allow members of "foo";
# range 10.17.224.10 10.17.224.250;
# }
# pool {
# deny members of "foo";
# range 10.0.29.10 10.0.29.230;
# }
#}

<% node[:dhcpd][:hosts].each do |name, config| %>
host <%= name %> {
hardware ethernet <%= config[:mac_address] %>;
fixed-address <%= config[:ip_address] %>;

option host-name "<%= name %>";
option domain-name "<%= node[:domain] %>";
option routers "<%= node[:dhcpd][:gateway] %>";
option subnet-mask "<%= node[:dhcpd][:netmask] %>";

<% if config[:pxe_boot] %>
next-server <%= node[:dhcpd][:tftp_server] %>;
filename "pxelinux.0"; # file on TFTP server
<% end %>
}
<% end %>
19 changes: 6 additions & 13 deletions djbdns/attributes/djbdns.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
djbdns Mash.new unless attribute?("djbdns")

djbdns[:tinydns_ipaddress] = "127.0.0.1" unless djbdns.has_key?(:tinydns_ipaddress)
djbdns[:tinydns_internal_ipaddress] = "127.0.0.1" unless djbdns.has_key?(:tinydns_internal_ipaddress)
djbdns[:axfrdns_ipaddress] = "127.0.0.1" unless djbdns.has_key?(:axfrdns_ipaddress)
djbdns[:public_dnscache_ipaddress] = ipaddress unless djbdns.has_key?(:public_dnscache_ipaddress)
default.djbdns[:tinydns_ipaddress] = "127.0.0.1"
default.djbdns[:tinydns_internal_ipaddress] = "127.0.0.1"
default.djbdns[:axfrdns_ipaddress] = "127.0.0.1"
default.djbdns[:public_dnscache_ipaddress] = node[:ipaddress]
# Default allowed networks is the current network class B
djbdns[:public_dnscache_allowed_networks] = [ipaddress.split(".")[0,2].join(".")] unless djbdns.has_key?(:public_dnscache_allowed_networks)
default.djbdns[:public_dnscache_allowed_networks] = [node[:ipaddress].split(".")[0,2].join(".")]
# Reverse DNS (PTR) networks
djbdns[:ptr_networks] = ['10.10', '172.16'] unless djbdns.has_key?(:ptr_networks)

# this may not exist on a first run of chef-solo on ec2
if attribute?("domain")
djbdns[:tinydns_internal_resolved_domain] = domain unless djbdns.has_key?(:tinydns_internal_resolved_domain)
end
default.djbdns[:ptr_networks] = ['10.10', '172.16']
9 changes: 8 additions & 1 deletion djbdns/recipes/cache.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,18 @@
end
end

template "/etc/public-dnscache/root/servers/#{node[:djbdns][:tinydns_internal_resolved_domain]}" do
template "/etc/public-dnscache/root/servers/#{node[:domain]}" do
source "dnscache-servers.erb"
mode 0644
end

search(:internal_zones, "*:*").each do |zone|
template "/etc/public-dnscache/root/servers/#{zone[:domain]}" do
source "dnscache-servers.erb"
mode 0644
end
end

@node[:djbdns][:ptr_networks].each do |network|
template "/etc/public-dnscache/root/servers/#{network}.in-addr.arpa" do
source "dnscache-servers.erb"
Expand Down
Loading

0 comments on commit 01c7a94

Please sign in to comment.