gpt4 book ai didi

puppet - 如何更改 vagrant 安装的 puppet 版本

转载 作者:行者123 更新时间:2023-12-04 09:52:19 26 4
gpt4 key购买 nike

我在一个精确的 32 基础盒子上使用 vagrant 1.0.1 来玩 puppet 。
配置工作正常,我的 list 正在执行。
默认情况下,vagrant 在客户机上的/opt/vagrant_ruby/bin/puppet 下安装 puppet 2.7.14。

我如何配置 vagrant(或曾经在 guest 上安装 puppet 的人)以使用更新的版本,例如 puppet 3.0 或 3.1?

最佳答案

您也可以使用在 puppet 配置器之前指定的 shell 配置器更新 puppet。如 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.



这是 CentOS 6 的示例 Vagrantfile :
# 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

关于puppet - 如何更改 vagrant 安装的 puppet 版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14792491/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com