diff --git a/chef/cookbooks/centos/recipes/main.rb b/chef/cookbooks/centos/recipes/main.rb index 3b9086de8..dd04a91d2 100644 --- a/chef/cookbooks/centos/recipes/main.rb +++ b/chef/cookbooks/centos/recipes/main.rb @@ -4,3 +4,4 @@ end include_recipe "centos::image_magick" include_recipe "centos::mongo_db" +include_recipe "common::main" diff --git a/chef/cookbooks/centos/recipes/mongo_db.rb b/chef/cookbooks/centos/recipes/mongo_db.rb index 9bfc958b5..25ab1a396 100644 --- a/chef/cookbooks/centos/recipes/mongo_db.rb +++ b/chef/cookbooks/centos/recipes/mongo_db.rb @@ -7,5 +7,9 @@ execute "refresh yum" do end execute "install mongo" do - command "yum install -y mongo-stable" + command "yum install -y mongo-stable-server" +end + +execute "make the data directory" do + command "mkdir -p /data/db" end diff --git a/chef/cookbooks/common/recipes/daemontools.rb b/chef/cookbooks/common/recipes/daemontools.rb new file mode 100644 index 000000000..ca385908c --- /dev/null +++ b/chef/cookbooks/common/recipes/daemontools.rb @@ -0,0 +1,14 @@ +execute "get the daemontools repo" do + command "mkdir -p /package/admin && cd /package/admin && git clone git://github.com/MikeSofaer/daemontools.git daemontools-0.76 || true" +end + +execute "compile daemontools" do + command "cd /package/admin/daemontools-0.76 && ./package/install" +end + +execute "mongo run" do + command "mkdir -p /service/mongo && echo '#!/bin/sh' > /service/mongo/run && echo 'exec /usr/bin/mongod' >> /service/mongo/run" +end +execute "executable" do + command "chmod -R 755 /service/mongo" +end diff --git a/chef/cookbooks/common/recipes/main.rb b/chef/cookbooks/common/recipes/main.rb new file mode 100644 index 000000000..dd787e529 --- /dev/null +++ b/chef/cookbooks/common/recipes/main.rb @@ -0,0 +1 @@ +include_recipe "common::daemontools"