我们没有找到至少一个具有 Puppet 功能的已配置智能代理

We did not find at least one configured Smart Proxy with the Puppet feature

我已经在 Ubuntu 12.04 中安装了 puppetmaster、puppet 和 foreman, puppetmaster 和 agent 配置为向工头报告并正常工作。

我可以在工头看到我的主人UI... 至此一切都很好......

现在的问题是,

我已经在 /etc/puppet/modules 目录中安装了 ntp、nexus 和其他模块,但是 none 其中 modules/classes 出现在工头 ui 中( 类 ) 部分。

我的配置

puppet agent  3.0.1
foreman       1.11
puppet master 3.0.1
ruby          1.9.3

在 puppet.conf 的主控部分,我有

[production] environment path set to /etc/puppet/modules

尝试重新启动 puppetmaster 和 foreman,但没有用

然后,我尝试了这个,

admin@host:/usr/share/foreman$ sudo foreman-rake db:migrate --trace
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke db:load_config (first_time)
** Execute db:load_config
** Execute db:migrate

admin@host:/usr/share/foreman$ sudo foreman-rake puppet:import:puppet_classes --trace
** Invoke puppet:import:puppet_classes (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute puppet:import:puppet_classes

我收到以下错误

ERROR: We did not find at least one configured Smart Proxy with the Puppet feature

顺便说一句,我已经配置了代理并且 运行 很好并且我在其中有日志服务 运行。我没有启用 SSL,但 http 端口是 运行 并且正在侦听...

更新 1:

现在我在 /etc/foreman-proxy/settings.d/settings.yml 下启用了 puppet.yml 和 SSL 选项。 然后我导航到工头 GUI 中的代理部分并找到了这个日志

Message
Couldn't enable plugin puppet: Gem loading error: cannot load such file -- augeas
Backtrace
/usr/lib/ruby/vendor_ruby/bundler_ext/output.rb:12:in `strict_err'
/usr/lib/ruby/vendor_ruby/bundler_ext/runtime.rb:50:in `rescue in block in system_require'
/usr/lib/ruby/vendor_ruby/bundler_ext/runtime.rb:39:in `block in system_require'
/usr/lib/ruby/vendor_ruby/bundler_ext/runtime.rb:37:in `each'
/usr/lib/ruby/vendor_ruby/bundler_ext/runtime.rb:37:in `system_require'
/usr/lib/ruby/vendor_ruby/bundler_ext.rb:19:in `block in system_require'
/usr/lib/ruby/vendor_ruby/bundler_ext.rb:14:in `each'
/usr/lib/ruby/vendor_ruby/bundler_ext.rb:14:in `system_require'
/usr/share/foreman-proxy/lib/bundler_helper.rb:22:in `require_groups'
/usr/share/foreman-proxy/lib/proxy/plugin.rb:151:in `configure_plugin'
/usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:31:in `block in configure_plugins'
/usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:29:in `each'
/usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:29:in `configure_plugins'
/usr/share/foreman-proxy/lib/proxy/plugin_initializer.rb:5:in `initialize_plugins'
/usr/share/foreman-proxy/lib/launcher.rb:114:in `configure_plugins'
/usr/share/foreman-proxy/lib/launcher.rb:124:in `launch'
/usr/share/foreman-proxy/bin/smart-proxy:6:in `<main>'

更新 2:

我尝试安装 ruby-augeas gem,但出现此错误,

sudo gem install ruby-augeas
Fetching: ruby-augeas-0.5.0.gem (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing ruby-augeas:
        ERROR: Failed to build gem native extension.

    current directory: /var/lib/gems/1.9.1/gems/ruby-augeas-0.5.0/ext/augeas
/usr/bin/ruby1.9.1 -r ./siteconf20160906-12554-zvrlfk.rb extconf.rb
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/usr/bin/ruby1.9.1
        --with-augeas-config
        --without-augeas-config
        --with-pkg-config
        --without-pkg-config
extconf.rb:27:in `<main>': augeas-devel not installed (RuntimeError)

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /var/lib/gems/1.9.1/extensions/x86_64-linux/1.9.1/ruby-augeas-0.5.0/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /var/lib/gems/1.9.1/gems/ruby-augeas-0.5.0 for inspection.

嗯,这里有一大堆问题。

  1. Foreman 1.11不是当前版本,请使用Foreman 1.12。它支持当前版本的 Puppet (4.x) 和更现代的 Ubuntu 版本。
  2. Puppet 3.0.x 是一个非常糟糕的版本,因为它 has poor support in Foreman 并且有很多问题。没有理由不使用 Puppet 3.8.x 或最好 4.x 与 Foreman 1.12.
  3. Ubuntu 12.04 是要安装新软件的非常旧的版本,请使用 16.04 或 14.04。 Foreman 1.11 已弃用其对 Ubuntu 12.04 的支持,因此我不建议对其进行新安装。
  4. 如果缺少 Augeas 依赖项,请安装软件包,不要尝试在顶部安装 gems - 您可能会引入新问题。 apt-get install libruby-augeas1.8

apt-get 安装 libaugeas-ruby1.9.1

这解决了我的问题