Browse files

added couchdb cookbook

  • Loading branch information...
1 parent fd07064 commit ed9b08bf92f4db8f76c3b344b63ded9093915b68 Ezra Zygmuntowicz committed Feb 22, 2009
Showing with 66 additions and 22 deletions.
  1. +0 −22 Rakefile
  2. +45 −0 cookbooks/couchdb/recipes/default.rb
  3. +21 −0 cookbooks/couchdb/templates/default/couch.ini.erb
View
22 Rakefile
@@ -37,28 +37,6 @@ def create_cookbook(dir)
# Recipe:: default
#
EOH
- case NEW_COOKBOOK_LICENSE
- when :apachev2
- file.puts <<-EOH
-# 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.
-#
-EOH
- when :none
- file.puts <<-EOH
-# All rights reserved - Do Not Redistribute
-#
-EOH
- end
end
end
end
View
45 cookbooks/couchdb/recipes/default.rb
@@ -0,0 +1,45 @@
+#
+# Cookbook Name:: couchdb
+# Recipe:: default
+#
+
+package "couchdb" do
+ verison "0.8.1"
+end
+
+directory "/db/couchdb/log" do
+ owner "couchdb"
+ group "couchdb"
+ mode 0755
+ recursive true
+end
+
+template "/etc/couchdb/couch.ini" do
+ owner 'root'
+ group 'root'
+ mode 0644
+ source "couch.ini.erb"
+ variables({
+ :basedir => '/db/couchdb',
+ :logfile => '/db/couchdb/log/couch.log',
+ :bind_address => '127.0.0.1', # '0.0.0.0' if you want couch available to the outside world
+ :port => '5984',# change if you want to listen on another port
+ :doc_root => '/usr/share/couchdb/www', # change if you have a cutom couch www root
+ :driver_dir => '/usr/lib/couchdb/erlang/lib/couch-0.8.1-incubating/priv/lib', # this is good for the 0.8.1 build on our gentoo
+ :loglevel => 'info'
+ })
+end
+
+execute "add-couchdb-to-default-run-level" do
+ command %Q{
+ rc-update add couchdb default
+ }
+ not_if "rc-status | grep couchdb"
+end
+
+execute "ensure-couchdb-is-running" do
+ command %Q{
+ /etc/init.d/couchdb restart
+ }
+ only_if "/etc/init.d/couchdb status | grep 'Apache CouchDB is not running'"
+end
View
21 cookbooks/couchdb/templates/default/couch.ini.erb
@@ -0,0 +1,21 @@
+[Couch]
+
+ConsoleStartupMsg=Apache CouchDB is starting.
+
+DbRootDir=<%= @basedir %>
+
+Port=<%= @port %>
+
+BindAddress=<%= @bind_address %>
+
+DocumentRoot=<%= @doc_root %>
+
+LogFile=<%= @logfile %>
+
+UtilDriverDir=<%= @driver_dir %>
+
+LogLevel=<%= @loglevel %>
+
+[Couch Query Servers]
+
+javascript=/usr/bin/couchjs /usr/share/couchdb/server/main.js

0 comments on commit ed9b08b

Please sign in to comment.