Created
August 7, 2014 14:43
-
-
Save davidbiehl/b5f7e76688a96b26c4ff to your computer and use it in GitHub Desktop.
My Favorite Vagrantfile (CentOS 6 with Librarian Puppet)
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
# Universal Configuration | |
# These configure the Vagrant VM so it can be used with the Puppet modules. | |
stage { 'pre': | |
before => Stage['main'], | |
} | |
# Install any dependencies | |
class dependencies { | |
package { ['git']: | |
ensure => latest, | |
} | |
package { 'librarian-puppet': | |
ensure => '0.9.14', | |
provider => 'gem' | |
} | |
} | |
class { "dependencies": | |
stage => pre, | |
} | |
exec {"librarian-puppet init": | |
path => "/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/vagrant/bin", | |
cwd => "/vagrant/puppet", | |
user => "vagrant", | |
group => "vagrant", | |
creates => "/vagrant/puppet/Puppetfile", | |
environment => "HOME=/home/vagrant", | |
require => [ Package["librarian-puppet"], Package["git"] ], | |
} | |
exec { "librarian-puppet install": | |
path => "/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/vagrant/bin", | |
cwd => "/vagrant/puppet", | |
user => "vagrant", | |
group => "vagrant", | |
environment => "HOME=/home/vagrant", | |
require => [ Exec["librarian-puppet init"] ], | |
} |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.box = "centos64" | |
config.vm.box_url = "http://puppet-vagrant-boxes.puppetlabs.com/centos-64-x64-vbox4210.box" | |
config.vm.provision :puppet do |puppet| | |
puppet.manifests_path = "puppet/manifests" | |
puppet.manifest_file = "librarian.pp" | |
end | |
config.vm.provision :puppet do |puppet| | |
puppet.manifests_path = "puppet/manifests" | |
puppet.module_path = "puppet/modules" | |
puppet.manifest_file = "default.pp" | |
end | |
config.vm.provider "virtualbox" do |v| | |
v.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/vagrant", "1"] | |
end | |
config.vm.network :public_network | |
config.vm.network :forwarded_port, guest: 80, host: 8080 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment