Vagrant Error:无法解析应用程序选项:invalid option: - managerstir

时间:2015-08-04 16:59:53

标签: linux vagrant puppet

我在运行Vagrant up时遇到以下错误,谷歌之后我发现人们说木偶最新版本不支持该选项,但不知道如何解决这个问题?

==> centos7base: Running provisioner: puppet...
==> centos7base: Running Puppet with site.pp...
==> centos7base: Error: Could not parse application options: invalid option: --manifestdir
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.

Vagrant版本:1.7.4

Vagrantfile:

config.vm.provision "puppet" do |puppet|
    puppet.facter = {
      "vagrant" => "1"
    }
    puppet.manifests_path = ["vm", "/Vagrant/puppet"]
    puppet.hiera_config_path = "puppet/hiera.yaml"
    puppet.module_path = "puppet/modules"
    puppet.manifest_file = "site.pp"
  end

2 个答案:

答案 0 :(得分:0)

您应该使用与Vagrantfile位置相关的文件夹,Vagrant足够智能,可以将其自身安装到实例中。

这是我的开发机器的工作实例的示例。其中有vagrant / Vagrantfile,但它也有与子目录在同一个vagrant /文件夹中的清单和模块的文件夹。

  config.vm.provision :puppet do |puppet|
    puppet.manifests_path = "manifests"
    puppet.module_path = "modules"
    puppet.options = ['--verbose']
    puppet.facter = {
        "fqdn" => "vagrant-test.domain.env"
    }
  end

答案 1 :(得分:0)

我使用Ubuntu / xenial64框时出现此问题;解决方案是 安装puppet-common包。我通过shell配置它的安装如下:

config.vm.provision“shell”,路径:“install-puppet.sh”

文件内容install-puppet.sh:

#!/bin/bash

cd /tmp
wget http://apt.puppetlabs.com/puppetlabs-release-pc1-xenial.deb
dpkg -i puppetlabs-release-pc1-xenial.deb
apt-get update
apt-get -y install puppet-common
echo "PATH=/opt/puppetlabs/bin:$PATH" >> /etc/bash.bashrc
echo "export PATH" >> /etc/bash.bashrc
export PATH=/opt/puppetlabs/bin:$PATH
相关问题