windows - Vagrant+图书馆员 puppet : unable to load puppet [Windows]

标签 windows virtual-machine vagrant puppet

我正在尝试使用 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+图书馆员 puppet : unable to load puppet [Windows],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27145229/

相关文章:

窗口命令 : Loop FOR with file containing space in his path

c - 可以采用大于 255 个字符的路径的 Windows 全路径 API 的替代方案!

linux - X个线程是通过X个进程实现的吗?

c - 显示完整的 Linux 命令行(gcc 输出)? (虚拟机上的c编程)

node.js - 提供期间无法在 Vagrant 上安装 NPM

android - Appium Android Windows : driver. findElement(By.name (""))不能连续工作

linux - 如何使用fdisk命名分区?

azure 虚拟机 IPv6 支持

vagrant - 在 Vagrant centos/7 中创建的文件不会出现在 Windows 中

centos - telnet : connect to address 192. 168.33.x: 连接被拒绝 - 在 Vagrant centos 机器上