Sha256: 8f287f1fc2e3736e1246e7e96d464780e488b6e7cb50037ac0eb98577015b198

Contents?: true

Size: 846 Bytes

Versions: 8

Compression:

Stored size: 846 Bytes

Contents

include_recipe "pivotal_server::daemontools"

install_dir = "/usr/local/mongo"

user "mongo"

run_unless_marker_file_exists("mongo_2_0") do
  execute "download mongo" do
    command "mkdir -p #{install_dir} && curl -Lsf http://downloads.mongodb.org/linux/mongodb-linux-i686-2.0.0.tgz | tar xvz -C#{install_dir} --strip 1"
  end

  execute "mongo owns #{install_dir}/data" do
    command "mkdir -p #{install_dir}/data && chown -R mongo #{install_dir}/data"
  end
end

execute "create daemontools directory" do
  command "mkdir -p /service/mongo"
end

execute "create run script" do
  command "echo -e '#!/bin/sh\nexec /command/setuidgid mongo  /usr/local/mongo/bin/mongod --dbpath #{install_dir}/data' > /service/mongo/run"
  not_if "ls /service/mongo/run"
end

execute "make run script executable" do
  command "chmod 755 /service/mongo/run"
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
lobot-0.10.3 lib/generators/lobot/templates/chef/cookbooks/pivotal_server/recipes/mongo_2_0.rb
lobot-0.10.2 lib/generators/lobot/templates/chef/cookbooks/pivotal_server/recipes/mongo_2_0.rb
lobot-0.10.1 lib/generators/lobot/templates/chef/cookbooks/pivotal_server/recipes/mongo_2_0.rb
lobot-0.10.0 lib/generators/lobot/templates/chef/cookbooks/pivotal_server/recipes/mongo_2_0.rb
lobot-0.9.7 lib/generators/lobot/templates/chef/cookbooks/pivotal_server/recipes/mongo_2_0.rb
lobot-0.9.6 lib/generators/lobot/templates/chef/cookbooks/pivotal_server/recipes/mongo_2_0.rb
lobot-0.9.5 lib/generators/lobot/templates/chef/cookbooks/pivotal_server/recipes/mongo_2_0.rb
lobot-0.9.4 lib/generators/lobot/templates/chef/cookbooks/pivotal_server/recipes/mongo_2_0.rb