Puppet Enterprise 文本模式安装时出错 - pe.conf 包含错误

Puppet Enterprise 文本模式安装时出错 - pe.conf 包含错误

我在 CentOS 镜像上启动了 puppet enterprise 安装,引导式安装运行良好。现在,我尝试使用类似的 CentOS 镜像以文本模式安装,但在检查 pe.conf 文件时出现错误。

# ./puppet-enterprise-installer -c /root/pe.conf
~/puppet-enterprise-2016.2.1-el-7-x86_64 ~/puppet-enterprise-2016.2.1-el-7-x86_64
=============================================================
    Puppet Enterprise Installer
=============================================================
2018-04-01 16:44:38,516 Running command: /opt/puppetlabs/puppet/bin/puppet agent       --disable='puppet-enterprise-installer preparing to configure node'

## We're installing the Puppet Agent...

2018-04-01 16:44:40,550 Running command: mkdir -p /opt/puppetlabs/server/data/packages/public/2016.2.1/el-7-x86_64-1.5.3
2018-04-01 16:44:40,554 Running command: cp -r -L /root/puppet-enterprise-2016.2.1-el-7-x86_64/packages/el-7-x86_64/* /opt/puppetlabs/server/data/packages/public/2016.2.1/el-7-x86_64-1.5.3
2018-04-01 16:44:44,874 Running command: cp -r -L /root/puppet-enterprise-2016.2.1-el-7-x86_64/packages/GPG-KEY-puppetlabs /opt/puppetlabs/server/data/packages/public
2018-04-01 16:44:44,879 Running command: mkdir -p /etc/yum.repos.d
2018-04-01 16:44:44,883 Running command: echo '[puppet_enterprise]' > /etc/yum.repos.d/puppet_enterprise.repo
2018-04-01 16:44:44,886 Running command: echo 'name=PuppetLabs PE Packages $releasever - $basearch' >> /etc/yum.repos.d/puppet_enterprise.repo
2018-04-01 16:44:44,890 Running command: echo 'baseurl=file:///opt/puppetlabs/server/data/packages/public/2016.2.1/el-7-x86_64-1.5.3' >> /etc/yum.repos.d/puppet_enterprise.repo
2018-04-01 16:44:44,893 Running command: echo 'enabled=1' >> /etc/yum.repos.d/puppet_enterprise.repo
2018-04-01 16:44:44,896 Running command: echo 'gpgcheck=1' >> /etc/yum.repos.d/puppet_enterprise.repo
2018-04-01 16:44:44,899 Running command: echo 'gpgkey=file:///opt/puppetlabs/server/data/packages/public/GPG-KEY-puppetlabs' >> /etc/yum.repos.d/puppet_enterprise.repo
2018-04-01 16:44:44,903 Running command: rpm --import /root/puppet-enterprise-2016.2.1-el-7-x86_64/packages/GPG-KEY-puppetlabs
2018-04-01 16:44:44,940 Running command: yum clean all --disablerepo='*' --enablerepo=puppet_enterprise
Loaded plugins: fastestmirror
Cleaning repos: puppet_enterprise
Cleaning up everything
Maybe you want: rm -rf /var/cache/yum, to also free up space taken by orphaned data from disabled or removed repos
Cleaning up list of fastest mirrors
2018-04-01 16:44:45,111 Running command: yum install -y puppet-agent pe-bundler pe-installer
Loaded plugins: fastestmirror
Determining fastest mirrors

{
 * base: mirrors.xmission.com
 * epel: mirrors.cat.pdx.edu
 * extras: mirror.keystealth.org
 * updates: repos.lax.quadranet.com
Package puppet-agent-1.5.3-1.el7.x86_64 already installed and latest version
Package pe-bundler-1.8.2-3.pe.el7.noarch already installed and latest version
Package pe-installer-2016.1.0.47-1.el7.x86_64 already installed and latest version
Nothing to do


## We're checking if /root/pe.conf contains valid HOCON syntax...

2018-04-01 16:44:46,698 Running command: /opt/puppetlabs/puppet/bin/ruby -e "require 'hocon';;begin;  conf = Hocon.load('/root/pe.conf');rescue Hocon::ConfigError::ConfigParseError => e;  puts %Q{\nERROR: Your pe.conf at /root/pe.conf contains invalid HOCON syntax: #{e}\n\n};  exit 1;end;;if conf['console_admin_password'] && conf['console_admin_password'].empty?;  puts %Q{\nERROR: Please specify a console_admin_password in your pe.conf file at /root/pe.conf.\n\n};  exit 1;end"
/opt/puppetlabs/puppet/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- hocon (LoadError)
    from /opt/puppetlabs/puppet/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from -e:1:in `<main>'
2018-04-01 16:44:46,740 [ERROR]: Your pe.conf file at /root/pe.conf contains errors.
2018-04-01 16:44:46,742 [ERROR]: Please check your pe.conf file for errors and try again.

我以为是语法错误,但我确实按照引导安装执行了 scp pe.conf,但仍然收到同样的错误。

这是我的 pe.conf 文件。

{
  "console_admin_password":"password",
  "puppet_enterprise::puppet_master_host": "vinjain1.mylab.com",
  "pe_install::puppet_master_dnsaltnames": [
    "puppet",
    "vinjain1"
  ],
  "puppet_enterprise::use_application_services": true
}

答案1

万一其他人遇到这个问题,我通过“/opt/puppetlabs/puppet/bin/gem install hocon”修复了这个问题,但不知何故,hocon gem 没有包含在内。

相关内容