Skip to content

Commit

Permalink
Added Vagrantfile and support files.
Browse files Browse the repository at this point in the history
Every good Puppet module deserves a Vagrantfile.
  • Loading branch information
garthk committed Apr 11, 2012
1 parent 5504c41 commit cc017dd
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
pkg/
.DS_Store
.vagrant
14 changes: 14 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant::Config.run do |config|
config.vm.box = "lucid32"
config.vm.host_name = 'mongo'
config.vm.share_folder "mongodb", "/tmp/vagrant-puppet/modules/mongodb", "."
# config.vm.network :hostonly, "192.168.31.48"
config.vm.provision :puppet do |puppet|
puppet.manifests_path = "tests"
puppet.manifest_file = "vagrant.pp"
puppet.options = ["--modulepath", "/tmp/vagrant-puppet/modules"]
end
end
1 change: 1 addition & 0 deletions tests/modules/mongodb
29 changes: 29 additions & 0 deletions tests/vagrant.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
stage { pre: before => Stage[main] }

class apt_get_update {
$sentinel = "/var/lib/apt/first-puppet-run"

exec { "initial apt-get update":
command => "/usr/bin/apt-get update && touch ${sentinel}",
onlyif => "/usr/bin/env test \\! -f ${sentinel} || /usr/bin/env test \\! -z \"$(find /etc/apt -type f -cnewer ${sentinel})\"",
timeout => 3600,
}
}

# The mongodb module requires python-software-packages, which can't be found
# on the Vagrant lucid32 image unless you run apt-get update first.
class { 'apt_get_update':
stage => pre,
}

# The Vagrant lucid32 image doesn't create the 'puppet' group, and can't
# properly finish a run without it.
group { 'puppet':
ensure => "present",
}

# Finally, we test our module:
class { 'mongodb':
# replSet => "set",
ulimit_nofile => 20000,
}

0 comments on commit cc017dd

Please sign in to comment.