Skip to content

Commit

Permalink
update to chef 0.9. Prefer nginx/unicorn over passenger. Too many oth…
Browse files Browse the repository at this point in the history
…er changes to mention here.
  • Loading branch information
jsierles2 committed Jul 13, 2010
1 parent 01c7a94 commit edefbd1
Show file tree
Hide file tree
Showing 182 changed files with 11,652 additions and 4,974 deletions.
39 changes: 39 additions & 0 deletions activemq/README.rdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
= DESCRIPTION:

Installs activemq and sets up a runit service.

= REQUIREMENTS:

Tested on Ubuntu 9.04.

Opscode cookbooks:

* java
* runit

= ATTRIBUTES:

* activemq[:mirror] - download URL up to the apache/activemq/apache-activemq directory.
* activemq[:version] - version to install.

= USAGE:

Include the default recipe on systems where you want to run activemq. At this time the cookbook doesn't use any custom configuration for activemq.

= LICENSE AND AUTHOR:

Author:: Joshua Timberman (<joshua@opscode.com>)

Copyright:: 2009, Opscode, Inc

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
23 changes: 23 additions & 0 deletions activemq/attributes/default.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#
# Cookbook Name:: activemq
# Attributes:: activemq
#
# Copyright 2009, Opscode, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

default.activemq[:dist_dir] = "/home/system/pkg/misc"
default.activemq[:version] = "5.3.1"
default.activemq[:user] = "nobody"
default.activemq[:group] = "nogroup"
14 changes: 14 additions & 0 deletions activemq/metadata.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
maintainer "Opscode, Inc."
maintainer_email "cookbooks@opscode.com"
license "Apache 2.0"
description "Installs activemq and sets it up as a runit service"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.rdoc'))
version "0.3"

%w{ubuntu debian}.each do |os|
supports os
end

%w{java runit}.each do |cb|
depends cb
end
54 changes: 54 additions & 0 deletions activemq/recipes/default.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#
# Cookbook Name:: activemq
# Recipe:: default
#
# Copyright 2009, Opscode, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

include_recipe "java"
include_recipe "runit"

amq_user = node[:activemq][:user]
amq_group = node[:activemq][:group]
version = node[:activemq][:version]
dist_dir = node[:activemq][:dist_dir]

directory "/opt" do
owner "root"
group "root"
mode 00755
end

unless File.exists?("/opt/apache-activemq-#{version}/bin/activemq")
execute "extract activemq" do
command "tar zxf #{dist_dir}/apache-activemq-#{version}-bin.tar.gz && chown -R #{amq_user}:#{amq_group} apache-activemq-#{version}"
cwd "/opt"
end
end

directory "/opt/apache-activemq-#{version}" do
owner amq_user
group amq_group
end

file "/opt/apache-activemq-#{version}/bin/activemq" do
owner amq_user
group amq_group
mode "0755"
end

runit_service "activemq" do
cookbook "activemq"
end
2 changes: 2 additions & 0 deletions activemq/templates/default/sv-activemq-log-run.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
exec svlogd -tt ./main
4 changes: 4 additions & 0 deletions activemq/templates/default/sv-activemq-run.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
exec 2>&1
cd /opt/apache-activemq-<%= @node[:activemq][:version] %>
exec su <%= @node[:activemq][:user] %> -c /opt/apache-activemq-<%= @node[:activemq][:version] %>/bin/activemq
55 changes: 55 additions & 0 deletions apt/files/default/sources.list.sc-chi
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# deb http://mirrors.servercentral.net/ubuntu lucid main restricted
# deb http://mirrors.servercentral.net/ubuntu lucid-updates main restricted
# deb http://security.ubuntu.com/ubuntu lucid-security main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.

deb http://mirrors.servercentral.net/ubuntu lucid main restricted
deb-src http://mirrors.servercentral.net/ubuntu lucid main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://mirrors.servercentral.net/ubuntu lucid-updates main restricted
deb-src http://mirrors.servercentral.net/ubuntu lucid-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://mirrors.servercentral.net/ubuntu lucid universe
deb-src http://mirrors.servercentral.net/ubuntu lucid universe
deb http://mirrors.servercentral.net/ubuntu lucid-updates universe
deb-src http://mirrors.servercentral.net/ubuntu lucid-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://mirrors.servercentral.net/ubuntu lucid multiverse
deb-src http://mirrors.servercentral.net/ubuntu lucid multiverse
deb http://mirrors.servercentral.net/ubuntu lucid-updates multiverse
deb-src http://mirrors.servercentral.net/ubuntu lucid-updates multiverse

## Uncomment the following two lines to add software from the 'backports'
## repository.
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
# deb http://mirrors.servercentral.net/ubuntu lucid-backports main restricted universe multiverse
# deb-src http://mirrors.servercentral.net/ubuntu lucid-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu lucid partner
# deb-src http://archive.canonical.com/ubuntu lucid partner

deb http://security.ubuntu.com/ubuntu lucid-security main restricted
deb-src http://security.ubuntu.com/ubuntu lucid-security main restricted
deb http://security.ubuntu.com/ubuntu lucid-security universe
deb-src http://security.ubuntu.com/ubuntu lucid-security universe
deb http://security.ubuntu.com/ubuntu lucid-security multiverse
deb-src http://security.ubuntu.com/ubuntu lucid-security multiverse
10 changes: 0 additions & 10 deletions apt/recipes/default.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@

if @node[:datacenter]
remote_file "/etc/apt/sources.list" do
source "sources.list.#{@node[:datacenter]}"
owner "root"
group "root"
mode 00644
end
end

execute "apt-get-update" do
command "apt-get update"
end
2 changes: 1 addition & 1 deletion apt/recipes/packages.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

if node[:packages]
node[:packages].each do |group, packages|
Chef::Log.info "Installing packages for package group, #{group}"
Chef::Log.debug "Installing packages for package group, #{group}"
packages.each do |name, options|
package name do
options.each { |opt, arg| send(opt.to_sym, arg) }
Expand Down
4 changes: 2 additions & 2 deletions autofs/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
owner "root"
group "root"
mode "0644"
notifies(:reload, resources(:service => "autofs"))
notifies :reload, resources(:service => "autofs"), :immediately
end

node[:autofs][:maps].each do |map, args|
Expand All @@ -30,6 +30,6 @@
mode 0644
source "auto.map.erb"
variables(:keys => args[:keys])
notifies(:reload, resources(:service => "autofs"))
notifies :reload, resources(:service => "autofs"), :immediately
end
end
7 changes: 0 additions & 7 deletions aws/definitions/aws_credentials.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,2 @@
define :aws_credentials do
remote_file "#{node[:aws][:path]}/#{params[:name]}.yml" do
source "#{params[:name]}.yml"
mode "0640"
cookbook "aws"
owner "root"
group "app"
end
end
2 changes: 1 addition & 1 deletion aws/recipes/tools.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
gem_package "thor"

remote_file "/usr/local/bin/s3_tool" do
cookbook_file "/usr/local/bin/s3_tool" do
mode 0755
end
7 changes: 4 additions & 3 deletions aws/templates/default/s3.yml.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
bucket: <%= @s3_bucket %>
access_key_id: <%= @aki %>
secret_access_key: <%= @sak %>
bucket_name: <%= @bucket %>
bucket: <%= @bucket %>
access_key_id: <%= @access_key_id %>
secret_access_key: <%= @secret_access_key %>

2 changes: 1 addition & 1 deletion bluepill/attributes/bluepill.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
default.bluepill[:bin] = node[:languages][:ruby][:bin_dir] + "/bluepill"
default.bluepill[:bin] = 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"
Expand Down
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.24'
default.bundler[:version] = '0.9.25'
6 changes: 3 additions & 3 deletions chef/attributes/client.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
default.chef[:client_version] = "0.8.11"
default.chef[:client_version] = "0.9.0"
default.chef[:client_path] = `which chef-client`.chomp
default.chef[:client_interval] = "300"
default.chef[:client_splay] = "20"
default.chef[:log_path] = "/var/log/chef/client.log"
default.chef[:client_enable] = false
default.chef[:client_log] = "/var/log/chef/client.log"
default.chef[:client_enable] = false
8 changes: 4 additions & 4 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.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[:server_version] = "0.9.5"
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'
4 changes: 0 additions & 4 deletions chef/recipes/client.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
include_recipe "logrotate"

gem_package "ohai" do
action :upgrade
end

gem_package "chef" do
action :install
version node[:chef][:client_version]
Expand Down
2 changes: 0 additions & 2 deletions chef/recipes/rabbitmq.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
include_recipe "rabbitmq"

Chef::Log.info("Configuring rabbitmq for chef.")

execute "rabbitmqctl add_vhost /chef" do
not_if "rabbitmqctl list_vhosts| grep /chef"
end
Expand Down
18 changes: 9 additions & 9 deletions chef/recipes/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
end

%w(/var/chef /etc/chef /var/log/chef /var/chef/openid /var/chef/ca /var/chef/cache /var/chef/pids /var/chef/sockets /var/chef/cookbooks
/var/chef/site-cookbooks /var/chef/cookbook-tarballs).each do |dir|
/var/chef/site-cookbooks /var/chef/cookbook-tarballs /var/chef/sandboxes /var/chef/checksums).each do |dir|
directory dir do
owner "chef"
group "admin"
Expand Down Expand Up @@ -63,13 +63,13 @@
end


%w(chef-server chef-server-api chef-server-webui).each do |app|
template "#{node[:languages][:ruby][:gems_dir]}/gems/#{app}-#{node[:chef][:server_version]}/config/init.rb" do
source "#{app}-init.rb.erb"
end
end
#%w(chef-server chef-server-api chef-server-webui).each do |app|
#template "#{node[:languages][:ruby][:gems_dir]}/gems/#{app}-#{node[:chef][:server_version]}/config/init.rb" do
# source "#{app}-init.rb.erb"
# end
#end

%w(chef-server chef-server-webui).each do |app|
%w(chef-server-api chef-server-webui).each do |app|
unicorn_conf = "/etc/chef/#{app}.unicorn.conf.rb"
directory "/var/chef/#{app}"

Expand Down Expand Up @@ -115,7 +115,7 @@
end

# install the wildcard cert for this domain
ssl_certificate "*.#{node[:public_domain] || node[:domain]}"
ssl_certificate "*.#{node[:domain]}"

nginx_site "chef-server" do
config_path "/etc/chef/server-vhost.conf"
Expand All @@ -125,4 +125,4 @@
command "curl -X POST http://localhost:5984/chef/_compact >> /var/log/cron.log 2>&1"
hour "5"
minute "0"
end
end
Loading

0 comments on commit edefbd1

Please sign in to comment.