Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I change the puppet version installed by vagrant

Tags:

vagrant

puppet

I use vagrant 1.0.1 on a precise32 base box to play with puppet. Provisioning works fine, my manifests are being executed. By default vagrant installs puppet 2.7.14 under /opt/vagrant_ruby/bin/puppet on the guest.

How can I configure vagrant (or who ever installs puppet on the guest) to use a more recent version like puppet 3.0 or 3.1?

like image 730
wischan Avatar asked Feb 09 '13 22:02

wischan


2 Answers

Also you could update puppet with shell provisioner specified before puppet provisioner. As said in Vagrant documentation:

Multiple config.vm.provision methods can be used to define multiple provisioners. These provisioners will be run in the order they're defined. This is useful for a variety of reasons, but most commonly it is used so that a shell script can bootstrap some of the system so that another provisioner can take over later.

Here is example Vagrantfile for CentOS 6:

# Update puppet to version 3.2.2 before using puppet provisioning.
$puppet_update_script = <<SCRIPT
[ `rpm -qa puppetlabs-release` = 'puppetlabs-release-6-7.noarch' ] || rpm -ivh http://yum.puppetlabs.com/el/6/products/i386/puppetlabs-release-6-7.noarch.rpm 
[ `rpm -qa puppet` = 'puppet-3.2.2-1.el6.noarch' ] || yum -y update-to puppet-3.2.2
SCRIPT
config.vm.provision :shell, :inline => $puppet_update_script

# Puppet-3.2.2 provisioning here
config.vm.provision :puppet do |puppet|
  puppet.options = '--parser future'
  puppet.manifests_path = 'puppet/manifests'
end
like image 72
vvolodko Avatar answered Sep 22 '22 12:09

vvolodko


You need to rebuild the basebox that you are using in vagrant and install whatever version of Puppet you want. I did the same for Cent 6.3 w/puppet 3.0. The Veewee gem is a great utility to building and managing Vagrant baseboxes for Oracle Virtualbox.

like image 30
Kyle Campos Avatar answered Sep 21 '22 12:09

Kyle Campos