Skip to content

Instantly share code, notes, and snippets.

@josephjaniga
Created September 20, 2015 14:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save josephjaniga/2c716d7ec1984c036c77 to your computer and use it in GitHub Desktop.
Save josephjaniga/2c716d7ec1984c036c77 to your computer and use it in GitHub Desktop.
Vagrant Provisioner Puppet Manifest for Mongodb
if versioncmp($::puppetversion,'3.6.1') >= 0 {
$allow_virtual_packages = hiera('allow_virtual_packages', false)
Package {
allow_virtual => $allow_virtual_packages,
}
}
class { 'nodejs':
version => 'v0.12.4',
}
file { [ "/data/", "/data/db/" ]:
ensure => "directory",
}
class {'::mongodb::globals':
manage_package_repo => true,
}->
class {'::mongodb::server':
bind_ip => ["0.0.0.0"],
port => 27017,
verbose => true,
auth => false,
}->
class {'::mongodb::client':}
mongodb_database { "dev":
ensure => present,
tries => 10,
require => Class['mongodb::server'],
}
mongodb_user { 'joe':
name => 'joe',
ensure => present,
password_hash => mongodb_password('joe', 'password'),
database => 'dev',
roles => ['readWrite', 'dbAdmin', 'dbOwner', 'userAdmin'],
}
service { "iptables":
ensure => "stopped",
hasstatus => "true",
status => "true",
}
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "puppetlabs/centos-6.6-64-puppet"
config.vm.box_version = "1.0.1"
config.vm.synced_folder ".", "/image-analyzer/"
config.vm.network "forwarded_port", guest: 27017, host: 27017
config.vm.network "forwarded_port", guest: 3000, host: 3000
config.vm.provision "puppet", run: "always" do |puppet|
puppet.manifests_path = "puppet/manifests"
puppet.module_path = "puppet/modules"
puppet.hiera_config_path = "puppet/hiera.yml"
puppet.working_directory = "/tmp/vagrant-puppet"
#puppet.options = "--verbose --debug"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment