Skip to content

Instantly share code, notes, and snippets.

@josephjaniga
Created September 20, 2015 14:48
Show Gist options
  • Select an option

  • Save josephjaniga/2c716d7ec1984c036c77 to your computer and use it in GitHub Desktop.

Select an option

Save josephjaniga/2c716d7ec1984c036c77 to your computer and use it in GitHub Desktop.

Revisions

  1. josephjaniga created this gist Sep 20, 2015.
    21 changes: 21 additions & 0 deletions Vagrantfile
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    # -*- 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
    45 changes: 45 additions & 0 deletions default.pp
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,45 @@
    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",
    }