0

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

我可以在工头 UI 中看到我的主机......到目前为止一切都很好............

现在的问题是,

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

我的配置

puppet agent  3.0.1
foreman       1.11
puppet master 3.0.1
ruby          1.9.3

在 puppet.conf 的 master 部分,我有

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

尝试重新启动 puppetmaster 和工头,但无法正常工作

然后,我尝试了这个,

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

我收到以下错误

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

顺便说一句,我配置了代理并且运行良好,并且我在其中运行了日志服务。我没有启用 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.
4

2 回答 2

2

嗯,这里有一大堆问题。

  1. Foreman 1.11 不是当前版本,请使用 Foreman 1.12。它支持当前版本的 Puppet (4.x) 和更现代的 Ubuntu 版本。
  2. Puppet 3.0.x 是一个非常糟糕的版本,因为它在 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 依赖项,请安装该软件包,不要尝试在顶部安装 gem - 您可能会引入新问题。apt-get install libruby-augeas1.8
于 2016-09-06T15:49:25.923 回答
0

apt-get 安装 libaugeas-ruby1.9.1

这解决了我的问题

于 2016-09-06T16:10:55.687 回答