Sha256: 0f14112ee255f45e49afa329bc3b20c1dfcf74e4cfd116235097bc2cb07ee2de

Contents?: true

Size: 1.12 KB

Versions: 3

Compression:

Stored size: 1.12 KB

Contents

namespace :setup do
  namespace :mongodb do

    task :sources do

      on roles(:mongodb) do
        unless test "[ -f /etc/apt/sources.list.d/mongodb-org-3.0.list ]"
          sudo %q[apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10]
          execute %q[echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list]
        end
      end

    end

  end

  task :mongodb do

    on roles(:mongodb) do
      install "mongodb-org"
      upload_as :root, file("etc/mongod.conf"), "/etc/mongod.conf"
      sudo "restart mongod || start mongod"
    end

  end

end

namespace :deploy do
  task :mongodb do
  end
end

namespace :firewall do
  task :mongodb do
    on roles(:mongodb) do |server|
      sudo :ufw, :allow, :in, 27017
      sudo :ufw, :allow, :in, 27018
      sudo :ufw, :allow, :in, 27019
      sudo :ufw, :allow, :in, 28017
    end
  end
end


before "deploy:publishing", "deploy:mongodb"
after "setup:firewall", "firewall:mongodb"
after "setup:system", "setup:mongodb"
before "setup:packages", "setup:mongodb:sources"

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
capistrano-cluster-0.0.16 tasks/roles/mongodb.rake
capistrano-cluster-0.0.15 tasks/roles/mongodb.rake
capistrano-cluster-0.0.14 tasks/roles/mongodb.rake