Skip to content

Instantly share code, notes, and snippets.

@gianlucacandiotti
Created May 22, 2015 17:51
Show Gist options
  • Save gianlucacandiotti/597058c6477d87e4448a to your computer and use it in GitHub Desktop.
Save gianlucacandiotti/597058c6477d87e4448a to your computer and use it in GitHub Desktop.
Basic default .pp configuration with Mongodb manual install.
# Requires nodejs, stdlib, apt and wget modules.
Exec { path => [ "/bin/", "/sbin/" , "/usr/bin/", "/usr/sbin/" ] }
exec { 'apt-get update':
command => 'apt-get update',
timeout => 60,
tries => 3,
}
class { 'apt':
update => {
frequency => 'always',
},
}
$sysPackages = [ 'build-essential', 'git']
package { $sysPackages:
ensure => "installed",
require => Exec['apt-get update'],
}
class { 'nodejs':
version => 'stable',
before => Exec['import-mongo-key'],
}
exec { 'import-mongo-key':
command => 'sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10',
timeout => 0,
} ->
exec { 'list-file-mongo':
command => 'echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb.list',
timeout => 0,
notify => Exec['apt_update'],
before => Exec['install-mongo'],
}
exec { 'install-mongo':
command => 'sudo apt-get install -y mongodb-org',
timeout => 0,
tries => 3,
onlyif => "sudo apt-get update"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment