-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Vagrantfile and support files.
Every good Puppet module deserves a Vagrantfile.
- Loading branch information
Showing
4 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
pkg/ | ||
.DS_Store | ||
.vagrant |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../.. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
} |