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/

相关文章:

windows - DOSKEY 召回别名

virtual-machine - 最小化VM时QTP无法单击Window弹出窗口的OK按钮

javascript - 检测 vagrant guest 机器中的文件更改

vagrant - 重新启动时出现Kubernetes vagrant错误:找不到并行 Vagrant 提供程序的必要组件

c++ - 如何使用 winsock 1.1 版实现 icmp 数据包处理程序?

mysql - 我在 mysqld.exe (Xampp) 中遇到高磁盘使用率

virtual-machine - 从 shell 将 VM(在 vbox 上运行)重启到特定(已编译)内核

ubuntu - 将数据集从我的 PC 上传到 Google Cloud Platform 上的虚拟机实例的最佳方式

apache - 无法创建缓存目录 (/vagrant/app/cache/dev)

windows - 用于检查计算机是否为域 Controller 的 PowerShell 脚本