使用模块路径开关运行木偶应用失败,并显示Error: Could not find class apt for vagrant.example.com on node vagrant.example.com
Puppet版本是3.7.3,运行在Ubuntu 14.04上,由Vagrant和VirtualBox管理
。这是我正在运行的命令:
sudo puppet apply --debug --verbose --modulepath '/tmp/vagrant-puppet-3/modules-0' /tmp/vagrant-puppet-3/manifests/default.pp
输出
vagrant@vagrant:~$ sudo puppet apply --debug --verbose --modulepath '/tmp/vagrant-puppet-3/modules-0' /tmp/vagrant-puppet-3/manifests/default.pp
Warning: Setting templatedir is deprecated. See http://links.puppetlabs.com/env-settings-deprecations
(at /usr/lib/ruby/vendor_ruby/puppet/settings.rb:1139:in `issue_deprecation_warning')
Debug: Runtime environment: puppet_version=3.7.3, ruby_version=1.9.3, run_mode=user, default_encoding=US-ASCII
Info: Loading facts
Debug: Loading facts from /tmp/vagrant-puppet-3/modules-0/puppetlabs-apt/lib/facter/apt_update_last_success.rb
Debug: Loading facts from /tmp/vagrant-puppet-3/modules-0/puppetlabs-apt/lib/facter/apt_updates.rb
Info: Loading facts
Debug: Loading facts from /tmp/vagrant-puppet-3/modules-0/puppetlabs-concat/lib/facter/concat_basedir.rb
Info: Loading facts
Debug: Loading facts from /tmp/vagrant-puppet-3/modules-0/puppetlabs-stdlib/lib/facter/facter_dot_d.rb
Debug: Loading facts from /tmp/vagrant-puppet-3/modules-0/puppetlabs-stdlib/lib/facter/pe_version.rb
Debug: Loading facts from /tmp/vagrant-puppet-3/modules-0/puppetlabs-stdlib/lib/facter/puppet_vardir.rb
Debug: Loading facts from /tmp/vagrant-puppet-3/modules-0/puppetlabs-stdlib/lib/facter/root_home.rb
Error: Could not find class apt for vagrant.example.com on node vagrant.example.com
Error: Could not find class apt for vagrant.example.com on node vagrant.example.com
/tmp/vagrant-puppet-3/manifests/default.pp' 的内容
node default
{
include apt
}
/tmp/vagrant-puppet-3/modules-0 的内容
drwxr-xr-x 1 root vagrant 714 Jan 5 20:03 puppetlabs-apt
drwxr-xr-x 1 root vagrant 680 Jan 5 20:03 puppetlabs-concat
drwxr-xr-x 1 root vagrant 782 Jan 5 20:03 puppetlabs-postgresql
drwxr-xr-x 1 root vagrant 782 Jan 5 20:03 puppetlabs-stdlib
使用相同的模块路径运行puppet module list
确实列出了模块(包括我所指的puppetlabs-apt),尽管带有依赖项警告。
vagrant@vagrant:~$ puppet module list --debug --verbose --modulepath '/tmp/vagrant-puppet-3/modules-0'
Warning: Missing dependency 'puppetlabs-apt':
'puppetlabs-postgresql' (v4.1.0) requires 'puppetlabs-apt' (>=1.1.0 <2.0.0)
Warning: Missing dependency 'puppetlabs-concat':
'puppetlabs-postgresql' (v4.1.0) requires 'puppetlabs-concat' (>= 1.1.0 <2.0.0)
Warning: Missing dependency 'puppetlabs-stdlib':
'puppetlabs-apt' (v1.7.0) requires 'puppetlabs-stdlib' (>= 2.2.1)
'puppetlabs-concat' (v1.1.2) requires 'puppetlabs-stdlib' (>= 3.2.0 < 5.0.0)
'puppetlabs-postgresql' (v4.1.0) requires 'puppetlabs-stdlib' (v4.x)
/tmp/vagrant-puppet-3/modules-0
├── puppetlabs-apt (v1.7.0)
├── puppetlabs-concat (v1.1.2)
├── puppetlabs-postgresql (v4.1.0)
└── puppetlabs-stdlib (v4.5.0)
奇怪的是,puppet module list
似乎找到了模块,但是引用我的清单文件中的任何模块都失败了(如果我尝试包含postgresql,则会出现相同的类错误)。我感觉我的清单文件是错误的。我在这里错过了一些明显的东西吗?
干杯
模块文件夹重命名puppetlabs-apt
为 apt
或更改 PP 代码
从
include apt
自
include puppetlabs-apt
取决于您在 apt pp 文件中的定义方式。