gpt4 book ai didi

windows - Vagrant+Librarian- puppet : unable to load puppet [Windows]

转载 作者:可可西里 更新时间:2023-11-01 10:21:45 24 4
gpt4 key购买 nike

我正在尝试使用 Vagrant 安装虚拟机。

  • Vagrant 版本:1.6.5
  • puppet 版本:3.7

错误信息:

Unable to load puppet. Please install it using native packages for your platform (eg .deb, .rpm, .dmg, etc).
puppet --version returned pid 4696 exit 1

最佳答案

我发现 Hashicorp 提供的脚本可以满足我的大部分 vagrant/puppet 引导需求。您可以在 https://github.com/hashicorp/puppet-bootstrap 找到它们

这是我如何在包含图书管理员的 Vagrantfile 中使用它的示例:

# Vagrantfile default
# 2012-2014 3E Enterprises, LLC

# This configuration will set up a default base VM provisioned with puppet.

# Assumes the use of VirtualBox 4.3.14-95030 as a provider.
# Uses vagrant-vbguest plugin (https://github.com/dotless-de/vagrant-vbguest)
# to keep VirtualBox Guest Addition wrangled.

# Configuration settings
BOOTSTRAP_SCRIPT = "vagrant_data/base/install.sh"
CPUS = "1"
IP = "192.168.50.4"
MEMORY = "512"
PROVIDER = "virtualbox"

# Eventually change this to a directory when this change hits vagrant (1.6.4?):
# https://github.com/mitchellh/vagrant/pull/4169
# This will kill the deprecation warning.
PUPPET_MANIFEST_FILE = "site.pp"

HIERA_CONFIG_PATH = "puppet/hiera.yaml"
PUPPET_MANIFESTS_PATH = "puppet/manifests"
PUPPET_MODULE_PATH = ["puppet/modules", "puppet/local_modules"]
SYNCED_FOLDER = "/vagrant"
SYNCED_FOLDER_TYPE = "nfs"
VAGRANT_VERSION_REQUIRE = ">= 1.6.5"
VAGRANTFILE_API_VERSION = "2"
VM_BOX = "ubuntu/trusty64"
VM_BOX_VERSION = "14.04"

# Lock down vagrant version.
Vagrant.require_version VAGRANT_VERSION_REQUIRE

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# vagrant-vbguest config
config.vbguest.no_install = false

# vagrant-librarian-puppet config
config.librarian_puppet.puppetfile_dir = "puppet"
config.librarian_puppet.placeholder_filename = ".gitkeep"

# Lock box version down.
config.vm.box = VM_BOX
config.vm.box_version = VM_BOX_VERSION
config.vm.box_check_update = true
config.vm.synced_folder ".", SYNCED_FOLDER, type: SYNCED_FOLDER_TYPE

if Vagrant.has_plugin?("vagrant-cachier")
# Configure cached packages to be shared between instances of the same base box.
# More info on the "Usage" link above
config.cache.scope = :box

# OPTIONAL: If you are using VirtualBox, you might want to use that to enable
# NFS for shared folders. This is also very useful for vagrant-libvirt if you
# want bi-directional sync

# config.cache.synced_folder_opts = {
# type: :nfs,
# # The nolock option can be useful for an NFSv3 client that wants to avoid the
# # NLM sideband protocol. Without this option, apt-get might hang if it tries
# # to lock files needed for /var/cache/* operations. All of this can be avoided
# # by using NFSv4 everywhere. Please note that the tcp option is not the default.
# mount_options: ['rw', 'vers=3', 'tcp', 'nolock']
# }
end

# Run the bootstrap script on every machine.
config.vm.provision :shell, :path => BOOTSTRAP_SCRIPT

# Build the base VM (base):
config.vm.define :"base", primary: true do |base|
base.vm.hostname = "base"
base.vm.network :private_network, ip: IP

base.vm.provision :puppet, run: "always" do |puppet|
puppet.hiera_config_path = HIERA_CONFIG_PATH
puppet.manifests_path = PUPPET_MANIFESTS_PATH
puppet.module_path = PUPPET_MODULE_PATH
puppet.manifest_file = PUPPET_MANIFEST_FILE
end

# Set up VM
base.vm.provider PROVIDER do |v|
v.customize [
"modifyvm", :id,
"--memory", MEMORY,
"--cpus", CPUS
]
end
end
end

祝你好运!

更新:

这里是我使用的开发环境:http://www.erikevenson.net/posts/2015/3/19/my-basic-development-environment

关于windows - Vagrant+Librarian- puppet : unable to load puppet [Windows],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27145229/

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