How do I change the puppet version installed by vagrant

旧城冷巷雨未停 提交于 2019-12-03 08:12:55

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.

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
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!