Evaluation Error: Error while evaluating a Function Call, Could not find class ::apt-get::update for ubuntu-bionic.example.com

Evaluation Error: Error while evaluating a Function Call, Could not find class ::apt-get::update for ubuntu-bionic.example.com

当 运行 人偶在 Vagrant/VirtualBox 上使用 "ubuntu/bionic64" 图像时,我收到以下错误:

Error: Evaluation Error: Error while evaluating a Function Call, Could not find class ::apt-get::update for ubuntu-bionic.example.com (file: /tmp/vagrant-puppet/manifests-846018e2aa141a5eb79a64b4015et6f3/default.pp, line: 2, column: 5) on node ubuntu-bionic.example.com
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.

环境:

流浪文件:

...
config.vm.box = "ubuntu/bionic64"
...
config.vm.provision "shell", inline: "apt-get update && apt-get install -y puppet"
config.vm.provision "puppet" do |puppet|
  puppet.module_path = "puppet/modules"
  puppet.manifests_path = "puppet/manifests"
  puppet.manifest_file  = "default.pp"
  puppet.options="--verbose --debug"
end
...

这个完全相同的人偶配置与 ubuntu/xenial64 盒子一起工作。我唯一更改的是我的 Vagrantfile 中的 config.vm.box 行(从 config.vm.box = "ubuntu/xenial64"config.vm.box = "ubuntu/bionic64"。我还确认我的模块存在并且我可以在 vm 中看到它/tmp 目录。

我可以通过将我的 apt-get 模块重命名为 apt_get 来解决问题。

从 Ubuntu Xenial 到 Ubuntu Bionic 将 Puppet 从 v3.8.5 升级到 v5.4.0。显然,using hyphens in a module name isn't allowed(虽然它曾经有效)。