Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Initial commit.

  • Loading branch information...
commit 1f14118019d1724b885b4f104477066341d8a26b 0 parents
@nanliu nanliu authored
Showing with 60 additions and 0 deletions.
  1. +3 −0  README.md
  2. +56 −0 manifests/init.pp
  3. +1 −0  tests/init.pp
3  README.md
@@ -0,0 +1,3 @@
+# puppet mongodb
+
+Installs mongodb on Ubuntu/Debian per 10gen installation documentation.
56 manifests/init.pp
@@ -0,0 +1,56 @@
+# Class: mongodb
+#
+# Parameters:
+#
+# Actions:
+#
+# Requires:
+#
+# Usage:
+#
+class mongodb (
+ $init = undef
+) {
+
+ # Install sysv or upstart package based on user override or best effort.
+ if $init == 'sysv' {
+ $location = 'http://downloads-distro.mongodb.org/repo/debian-sysvinit'
+ } elsif $init == 'upstart' {
+ $location = 'http://downloads-distro.mongodb.org/repo/ubuntu-upstart'
+ } else {
+ case $::operatingsystem {
+ 'Debian': {
+ $location = 'http://downloads-distro.mongodb.org/repo/debian-sysvinit'
+ }
+ 'Ubuntu': {
+ $location = 'http://downloads-distro.mongodb.org/repo/ubuntu-upstart'
+ }
+ }
+ }
+
+ include 'apt'
+
+ # The configuration doesn't follow convention, so release, repos is odd:
+ # http://www.mongodb.org/display/DOCS/Ubuntu+and+Debian+packages
+ apt::source { '10gen':
+ location => $location,
+ release => 'dist',
+ repos => '10gen',
+ key => '7F0CEB10',
+ key_server => 'keyserver.ubuntu.com',
+ pin => '-10',
+ include_src => false,
+ before => Package['mongodb-10gen'],
+ }
+
+ package { 'mongodb-10gen':
+ ensure => present,
+ }
+
+ service { 'mongodb':
+ ensure => running,
+ enable => true,
+ require => Package['mongodb-10gen'],
+ }
+
+}
1  tests/init.pp
@@ -0,0 +1 @@
+include mongodb
Please sign in to comment.
Something went wrong with that request. Please try again.