1.6. 手动安装和配置 Puppet 代理

您可以在主机上手动安装和配置 Puppet 代理。主机上需要配置了 Puppet 代理,以便 Puppet 与您的 Satellite 集成。

先决条件

  • Puppet 必须在您的 Satellite 中启用。如需更多信息,请参阅 第 1.3 节 “启用与 Satellite 集成的 Puppet”
  • 主机必须分配有 Puppet 环境。
  • 必须启用 Satellite Client 6 存储库并同步到 Satellite 服务器,并在主机上启用。如需更多信息,请参阅 管理内容 中的 导入内容

流程

  1. root 用户身份登录主机。
  2. 安装 Puppet 代理软件包。

    • 在运行 Red Hat Enterprise Linux 8 及更高版本的主机上:

      # dnf install puppet-agent
    • 在运行 Red Hat Enterprise Linux 7 及更早版本的主机上:

      # yum install puppet-agent
  3. 使用以下脚本,将 Puppet 代理添加到当前 shell 中的 PATH 中:

    . /etc/profile.d/puppet-agent.sh
  4. 配置 Puppet 代理。将 environment 参数设置为主机所属的 Puppet 环境的名称:

    # puppet config set server satellite.example.com --section agent
    # puppet config set environment My_Puppet_Environment --section agent
  5. 启动 Puppet 代理服务:

    # puppet resource service puppet ensure=running enable=true
  6. 为主机创建证书:

    # puppet ssl bootstrap
  7. 在 Satellite Web UI 中,导航到 Infrastructure > Capsules
  8. 从所需胶囊服务器 的操作 列中的列表中,选择 证书
  9. 单击所需主机右侧的 Sign to,以签署 Puppet 代理的 SSL 证书。
  10. 在主机上再次运行 Puppet 代理:

    # puppet ssl bootstrap