Permalink
Browse files

Vagrant setup now works with Puppet 4

  • Loading branch information...
rwilcox committed Jan 17, 2016
1 parent d965326 commit 54923f6b362e38fb352ffff97d0b88c96ad89fd1
Showing with 24 additions and 8 deletions.
  1. +21 −8 Vagrantfile
  2. +3 −0 puppet/environment.conf
View
@@ -6,22 +6,35 @@ Vagrant.configure("2") do |config|
vm.cpus = 2
end
config.vm.provision :shell, path: "vagrant_tools/remove_puppet_unless_modern.sh" # this VM has a VERY old Puppet version, install 3.7+
puppet_environment = "puppet" # the name of the directory in this source tree that contains the puppet modules, manifests and environment.config
# ^^^^^ !!!!! if changing me change value in #{folder_formerly_known_as_puppet}/environment.config !!!!!!
puppet_environment_path_on_guest = "/etc/puppetlabs/code/environments/#{puppet_environment}"
module_path_on_guest = "#{puppet_environment_path_on_guest}/modules"
config.vm.provision :shell, path: "vagrant_tools/remove_puppet_unless_modern.sh" # this VM (may) have a VERY old Puppet version, install 4.3
config.vm.provision :shell, path: "vagrant_tools/install_puppet_on_ubuntu.sh"
config.vm.provision :shell, :path => "vagrant_tools/use_modern_ruby.sh" # Ubuntu 12 Above box is set with Ruby 1.8.7 WITH NO RUBYGEMS as default Ruby. Set to sane version.
config.vm.provision :shell, :inline => "test -d /etc/puppet/modules/apt || puppet module install puppetlabs-apt"
config.vm.provision :shell, :inline => "test -d /etc/puppet/modules/nodejs || puppet module install puppetlabs-nodejs"
config.vm.provision :shell, :inline => "test -d /etc/puppet/modules/python || puppet module install stankevich-python"
config.vm.provision :shell, :inline => "test -d /etc/puppet/modules/redis || puppet module install thomasvandoren-redis"
config.vm.provision :shell, :inline => "test -d /etc/puppet/modules/rubybuild || puppet module install benben-rubybuild"
config.vm.provision :shell, :inline => "test -d #{module_path_on_guest}/ || mkdir #{puppet_environment_path_on_guest}"
config.vm.provision :shell, :inline => "test -d #{module_path_on_guest}/apt || puppet module install puppetlabs-apt --environment=#{puppet_environment}"
config.vm.provision :shell, :inline => "test -d #{module_path_on_guest}/nodejs || puppet module install puppetlabs-nodejs --environment=#{puppet_environment}"
config.vm.provision :shell, :inline => "test -d #{module_path_on_guest}/python || puppet module install stankevich-python --environment=#{puppet_environment}"
config.vm.provision :shell, :inline => "test -d #{module_path_on_guest}/redis || puppet module install thomasvandoren-redis --environment=#{puppet_environment}"
config.vm.provision :shell, :inline => "test -d #{module_path_on_guest}/rubybuild || puppet module install benben-rubybuild --environment=#{puppet_environment}"
config.vm.provision :puppet do |puppet|
if ENV.key?('PUPPET_OPTS') # See http://stackoverflow.com/a/27540417/224334
puppet.options = ENV['PUPPET_OPTS'].split(' ')
end
puppet.module_path = "modules"
if ENV["PUPPET_VERBOSE"] then puppet.options = "--verbose --debug" end
puppet.environment = "puppet"
puppet.environment_path = "./"
puppet.manifests_path = "puppet/manifests"
puppet.manifest_file = "lucid32.pp"
puppet.facter = {
project_name: "ENGLISH NAME Of PROJECT", # EDIT THIS LINE
View
@@ -0,0 +1,3 @@
# hardcoded module path is "fine" because we're in the "puppet" directory in our source tree...
modulepath = ./modules:$codedir/environments/puppet/modules/:$basemodulepath

0 comments on commit 54923f6

Please sign in to comment.