How do I change the puppet version installed by vagrant

耗尽温柔 提交于 2019-12-04 11:45:02

问题


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?


回答1:


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.




回答2:


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


来源:https://stackoverflow.com/questions/14792491/how-do-i-change-the-puppet-version-installed-by-vagrant

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