我在使用puppetdb查询的puppet运行时遇到错误:
Info: Retrieving pluginfacts Info: Retrieving plugin Info: Loading facts Error: Could not retrieve catalog from remote server: Error 400 on SERVER: undefined method `server_urls' for #<Puppet::Util::Puppetdb::Config:0x00000003cd66c8> at /etc/puppet/local-modules/monitoring/manifests/init.pp:14 on node hostname.goes.here Warning: Not using cache on failed catalog Error: Could not retrieve catalog; skipping run
通过运行puppet --verbose ,我得到一个警告 ,看起来很有帮助:
Warning: It looks like you are using a PuppetDB version < 3.0. This version of puppetdbquery requires at least PuppetDB 3.0 to work. Downgrade to puppetdbquery 1.x to use it with PuppetDB 2.x.
PuppetDB 3.0在有问题的机器上不可用,所以我正在降级puppetdbquery 。 但是,我找不到在哪里/如何安装。 到目前为止,我已经检查了dpkg (我正在运行Debian Jessie), gem和librarian-puppet ,但是他们中没有一个似乎已经安装了puppetdbquery 。
无论如何要find它来自哪里以及如何降级?
puppetdbquery是一个puppet模块,即使它不在你的Puppet文件中,它也可以作为你的其他模块的依赖来安装。
看看你的木偶大师模块path中列出的目录。
您引用的错误消息可以在该模块的lib / puppetdb / connection.rb中find。
为了追踪这个文件(感谢ssm对这个链接的回答 ),我这样做了:
find / -name connection.rb
然后,我对包含“看起来你正在使用PuppetDB版本<3.0”的结果进行了仔细的分析。结果我得到了一个文件:
/var/lib/gems/2.1.0/gems/ruby-puppetdb-2.1.1/lib/puppetdb/connection.rb
起初,这使我困惑,因为它没有提到puppetdbquery,但仔细检查存储库 ,我看到gemspec它包括调用本身“ruby-puppetdb”,而不是puppetdbquery。 因此,修复是运行:
gem uninstall ruby-puppetdb --version 2.1.1
我已经安装了旧版本的gem,所以系统回退到使用它们。
总结: 当安装成gem时,puppetdbquery被称为ruby-puppetdb