Sha256: 5c4884e0edfeaa90314e3611668f69bc9d9783fa1d63dc9e2339cd9ee0647229

Contents?: true

Size: 1.22 KB

Versions: 10

Compression:

Stored size: 1.22 KB

Contents

namespace :rubber do
  
  namespace :mongodb do
    
    rubber.allow_optional_tasks(self)
    
    before "rubber:install_packages", "rubber:mongodb:install"
    after "rubber:install_packages", "rubber:mongodb:setup_paths"
  
    task :install, :roles => :mongodb do
      # Setup apt sources to mongodb from 10gen
      sources = <<-SOURCES
        deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen
      SOURCES
      sources.gsub!(/^ */, '')
      put(sources, "/etc/apt/sources.list.d/mongodb.list") 
      rsudo "apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10"
    end
    
    task :setup_paths, :roles => :mongodb do
      rsudo "mkdir -p #{rubber_env.mongodb_data_dir}"
      rsudo "chown -R mongodb:mongodb #{rubber_env.mongodb_data_dir}"
    end
    
    desc <<-DESC
      Starts the mongodb daemon
    DESC
    task :start, :roles => :mongodb do
      rsudo "service mongodb start"
    end
    
    desc <<-DESC
      Stops the mongodb daemon
    DESC
    task :stop, :roles => :mongodb do
      rsudo "service mongodb stop"
    end
    
    desc <<-DESC
      Restarts the mongodb daemon
    DESC
    task :restart, :roles => :mongodb do
      rsudo "service mongodb restart"
    end
    
  end

end

Version data entries

10 entries across 5 versions & 1 rubygems

Version Path
rubber-1.14.1 lib/generators/vulcanize/templates/mongodb/config/rubber/deploy-mongodb.rb
rubber-1.14.1 generators/vulcanize/templates/mongodb/config/rubber/deploy-mongodb.rb
rubber-1.14.0 generators/vulcanize/templates/mongodb/config/rubber/deploy-mongodb.rb
rubber-1.14.0 lib/generators/vulcanize/templates/mongodb/config/rubber/deploy-mongodb.rb
rubber-1.13.2 lib/generators/vulcanize/templates/mongodb/config/rubber/deploy-mongodb.rb
rubber-1.13.2 generators/vulcanize/templates/mongodb/config/rubber/deploy-mongodb.rb
rubber-1.13.1 lib/generators/vulcanize/templates/mongodb/config/rubber/deploy-mongodb.rb
rubber-1.13.1 generators/vulcanize/templates/mongodb/config/rubber/deploy-mongodb.rb
rubber-1.13.0 generators/vulcanize/templates/mongodb/config/rubber/deploy-mongodb.rb
rubber-1.13.0 lib/generators/vulcanize/templates/mongodb/config/rubber/deploy-mongodb.rb