Vagrant with puppet, --manifestdir 提供错误

Vagrant with puppet, --manifestdir provision error

我想开始一个小项目来学习 Vagrat 和 puppet,所以我用 Vagrant 创建了一个 DEbian VM。

VM 本身运行良好,但当我尝试使用 Puppet 为它配置时出现问题。

这是我得到的错误:

==> default: Running provisioner: puppet...
==> default: Running Puppet with default.pp...
==> default: stdin: is not a tty
==> default: 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.

这是我的目录树:

这是我的 Vagrantfile:

Vagrant.configure(2) do |config|
  config.vm.box = "puphpet/debian75-x64"

  config.vm.network "forwarded_port", guest: 80, host: 4527

  config.vm.provision :shell, :inline => "apt-get update --fix-missing"
  config.vm.provision "puppet" do |puppet|
    puppet.manifests_path = "manifests"
    puppet.manifest_file = "default.pp"
  end
end

这是我的人偶清单:

exec { 'apt-update':
  command => '/usr/bin/apt-get update'
}

package { 'nginx':
  require => Exec['apt-update'],
  ensure => installed,
}

package { 'php5':
  require => Exec['apt-update'],
  ensure => installed,
}

package { 'redis-server':
  require => Exec['apt-update'],
  ensure => installed,
}

我在 Ubuntu 15.10、VirtualBox 5.0.14 和 Vagrant 1.7.4

你的盒子 latest version 支持 puppet 4.x 并且 manifest_dir 在 puppet 4.x

中被弃用

您还可以阅读 vagrant doc

If only environment and environments_path are specified, it will parse and use the manifest specified in the environment.conf file. If manifests_path and manifest_file is specified along with the environment options, the manifest from the environment will be overridden by the specified manifest_file. If manifests_path and manifest_file are specified without environments, the old non-environment mode will be used (which will fail on Puppet 4+).

所以你需要:

  • 升级你的 puppet 结构以支持 puppet 4.x(迁移到目录环境)
  • 或者降级你的盒子的版本以便安装 puppet 3.x