Red Hat Ansible Automation Platform 安装指南


Red Hat Ansible Automation Platform 2.3

了解如何根据支持的安装场景安装 Red Hat Ansible Automation Platform。

Red Hat Customer Content Services

摘要

提供反馈:
如果您对本文档有任何改进建议,或发现错误,请联系技术支持 https://access.redhat.com,使用 Docs组件在 Ansible Automation PlatformJIRA 项目中创建一个问题。

前言

感谢您对 Red Hat Ansible Automation Platform 的关注。Ansible Automation Platform 是一个商业产品,它可以帮助团队通过增加控制、知识、协调基于 Ansible 的环境来更好地管理多阶的复杂部署环境。

本指南帮助您了解安装 Ansible Automation Platform 后的安装要求和流程。本文档已更新,以包含 Ansible Automation Platform 最新版本的信息。

使开源包含更多

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。我们从这四个术语开始:master、slave、黑名单和白名单。由于此项工作十分艰巨,这些更改将在即将推出的几个发行版本中逐步实施。有关更多详情,请参阅我们的首席技术官 Chris Wright 提供的消息

第 1 章 Red Hat Ansible Automation Platform 安装概述

Red Hat Ansible Automation Platform 安装程序为您提供了灵活性,允许您使用多个支持的安装方式安装 Ansible Automation Platform。

无论您选择什么安装方式,安装 Ansible Automation Platform 都涉及以下步骤:

编辑 Red Hat Ansible Automation Platform 安装程序清单文件
Ansible Automation Platform 安装程序清单文件允许您指定安装方式,并描述 Ansible 的主机部署。本文档中提供的示例显示了为您的部署安装该场景所需的参数规格。
运行 Red Hat Ansible Automation Platform 安装程序设置脚本
设置脚本使用清单文件中定义的所需参数安装 Private Automation Hub。
验证自动化控制器安装
安装 Ansible Automation Platform 后,您可以通过登录到自动化控制器来验证安装是否成功。
验证自动化中心安装
安装 Ansible Automation Platform 后,您可以通过登录到自动化中心来验证安装是否成功。
安装后的步骤
成功安装后,您可以开始使用 Ansible Automation Platform 的功能。

其他资源

有关支持的安装场景的更多信息,请参阅 Red Hat Ansible Automation Platform 计划指南

1.1. 先决条件

警告

如果您在 Ansible Automation Platform 安装前没有完全升级 RHEL 节点,您可能会遇到错误。

其他资源

有关获取平台安装程序或系统要求的更多信息,请参阅 Red Hat Ansible Automation Platform 规划指南中的 Red Hat Ansible Automation Platform 系统要求

第 2 章 系统要求

在规划 Red Hat Ansible Automation Platform 安装并设计适合您的用例的自动化网格拓扑时,请使用此信息。

先决条件

  • 您必须能够通过 sudo 命令或特权升级来获取 root 访问权限。有关权限升级的更多信息,请参阅了解特权升级
  • 您需要能够将权限从 root 降级到普通用户,例如: AWX、PostgreSQL、或 Pulp。
  • 您必须在所有节点上配置 NTP 客户端。如需更多信息,请参阅使用 Chrony 配置 NTP 服务器

2.1. Red Hat Ansible Automation Platform 系统要求

您的系统必须满足以下最低系统要求才能安装和运行 Red Hat Ansible Automation Platform。

表 2.1. 基本系统
要求必填备注

订阅

有效的 Red Hat Ansible Automation Platform

 

OS

Red Hat Enterprise Linux 8.6 或更高的 64 位版本(x86,ppc64le, s390x, aarch64), 或 Red Hat Enterprise Linux 9.0 or later 64-bit (x86,ppc64le, s390x, aarch64)

Red Hat Ansible Automation Platform 在 OpenShift 上也支持,请参阅在 OpenShift Container Platform 上部署 Red Hat Ansible Automation Platform Operator。

Ansible

2.14 版本(安装)

Ansible Automation Platform 附带了包含 ansible-core 2.14 的执行环境。

Python

3.8 或更高版本

 

浏览器

当前支持的 Mozilla FireFox 或 Google Chrome 版本

 

数据库

PostgreSQL 版本 13

 

在使用项目更新和集合时,需要满足以下条件:

  • 确保以下域名是防火墙或代理的允许列表一部分,以便能成功连接并从自动化中心或 Galaxy 服务器下载集合:

    • galaxy.ansible.com
    • cloud.redhat.com
    • console.redhat.com
    • sso.redhat.com
  • 在使用自签名证书或红帽域时,必须禁用 SSL 检查。
注意

由 Ansible Automation Platform 管理的系统的要求与 Ansible 相同。请参阅 Ansible 用户指南中的快速入门部分。

有关 Red Hat Ansible Automation Platform 要求的额外备注

  • 由 Ansible Automation Platform 管理的系统的要求与 Ansible 相同。请参阅 Ansible 用户指南中的快速入门部分。
  • 虽然 Red Hat Ansible Automation Platform 依赖于 Ansible Playbook,并且在安装自动化控制器前需要安装最新版本的 Ansible,但不再需要手动安装 Ansible。
  • 对于新安装,自动化控制器会安装最新版本的 Ansible 2.3。
  • 如果执行捆绑的 Ansible Automation Platform 安装,安装程序会尝试从捆绑包中安装 Ansible(及其依赖项)。
  • 如果您选择自己手动安装 Ansible,Ansible Automation Platform 安装程序会检测到已安装的 Ansible,并且不会尝试重新安装它。
注意

您必须使用软件包管理器(如 yum )安装 Ansible,必须安装软件包管理器的最新稳定版本,以便 Red Hat Ansible Automation Platform 正常工作。版本 2.3 及更新的版本需要 Ansible 2.14 版本。

2.2. 自动化控制器系统要求

自动化控制器是一种分布式系统,不同的软件组件可以并置或部署到多个不同计算节点上。在安装程序中,节点类型控制、混合、执行和跃点作为抽象层提供,以帮助用户设计适合其用例的拓扑。

对节点大小使用以下建议:

注意

在控制和混合节点上,为执行环境存储分配至少 20 GB 的 /var/lib/awx

执行节点

运行自动化。增加内存和 CPU 以增加容量来运行更多分叉

要求必填

RAM

16 GB

CPU

4

本地磁盘

最小 40GB

控制节点

处理事件并运行集群作业,包括项目更新和清理作业。增加 CPU 和内存有助于处理作业事件。

要求必填

RAM

16 GB

CPU

4

本地磁盘

  • 至少 40GB,在 /var/lib/awx 下至少有 20GB
  • 存储卷的最低基础线必须被定做 1500 IOPS
  • 项目存储在控制和混合节点上,作业持续时间也存储在执行节点上。如果集群有很多大型项目,请考虑在 /var/lib/awx/projects 中调整 GB,以避免磁盘空间错误

混合节点

运行自动化和集群作业。执行和控制节点的 CPU 和内存上的注释也适用于此节点类型。

要求必填

RAM

16 GB

CPU

4

本地磁盘

  • 至少 40GB,在 /var/lib/awx 下至少有 20GB
  • 存储卷的最低基础线必须被定做 1500 IOPS
  • 项目存储在控制和混合节点上,作业持续时间也存储在执行节点上。如果集群有很多大型项目,请考虑在 /var/lib/awx/projects 中调整 GB,以避免磁盘空间错误

跃点(hop)节点

用于将来自自动化网格的一个部分的流量路由到另一个网络(例如,可以是堡垒主机到另一网络)。RAM 可能会影响吞吐量,CPU 活动较低。网络带宽和延迟通常比 RAM 或 CPU 更重要。

要求必填

RAM

16 GB

CPU

4

本地磁盘

40GB

  • 实际 RAM 的要求取决于同时管理的主机自动化控制器数量(这由作业模板或系统 ansible.cfg 文件中的 forks 参数控制)。为避免可能的资源冲突,Ansible 建议每 10 个 fork 需要 1 GB 内存再加上 2GB 保留用于自动化控制器,请参阅 Automation controller Capacity Determination and Job Impact。如果 fork 设为 400,则建议使用 42 GB 内存。
  • 自动化控制器主机检查 umask 是否已设置为 0022。如果没有,则设置会失败。设置 umask=0022 以避免出现这个错误。
  • 可以处理更多主机,但如果 fork 数量小于主机总数,则需要在主机间通过更多。您可以使用以下方法之一避免这些 RAM 限制:

    • 使用滚动更新。
    • 使用内置在自动化控制器中的置备回调系统,其中每个请求配置的系统都会进入队列,并尽快处理。
    • 如果自动化控制器正在生成或部署镜像,如 AMI。

其他资源

2.3. Automation hub 系统要求

通过自动化中心,您可以从 Red Hat Ansible 和认证合作伙伴发现并使用新的认证自动化内容。在 Ansible Automation Hub 上,您可以发现和管理由红帽及其合作伙伴开发的自动化内容的 Ansible 集合,用于云自动化、网络自动化和安全自动化等用例。

自动化中心有以下系统要求:

要求必填备注

RAM

最小 8 GB

  • 8 GB RAM(Vagrant trial 版本安装的最小和推荐值)
  • 8 GB RAM(外部独立 PostgreSQL 数据库最小值)
  • 有关您配置中基于 fork 的容量,请查看其他资源

CPU

最少 2 个

有关配置中基于 fork 的容量,请参阅其他资源。

本地磁盘

60 GB 磁盘

至少 40GB 专用于 /var 用于集合存储。

注意

私有自动化中心

如果您从内部地址安装私有自动化中心,并且具有仅包含外部地址的证书,这可能会导致安装无法用作容器 registry,且没有证书问题。

要避免这种情况,请使用带有如 https://pah.example.com 值的 automationhub_main_url 清单变量链接到在安装清单文件中的自动化中心节点。

这会将外部地址添加到 /etc/pulp/settings.py

这代表,您只使用外部地址。

有关清单文件变量的详情,请参考 Red Hat Ansible Automation Platform 安装指南中的清单文件变量

2.4. PostgreSQL 要求

Red Hat Ansible Automation Platform 使用 PostgreSQL 13。

  • 在将 PostgreSQL 用户密码保存到数据库前,会使用 SCRAM-SHA-256 安全散列算法对其进行处理。
  • 要确定您的自动化控制器实例是否可以访问数据库,则可以使用 awx-manage check_db 命令。
表 2.2. 数据库
服务必填备注

每个自动化控制器

40 GB 专用硬盘空间

  • 有专用的 20 GB 的 /var/ 目录。
  • 存储卷的最低基础线必须被定为 1500 IOPS。
  • 项目存储在控制和混合节点上,作业持续时间也存储在执行节点上。如果集群有很多大型项目,请考虑在 /var/lib/awx/projects 中使用两倍的 GB,以避免磁盘空间错误。
  • 建议大于 150 GB

每个自动化中心

60 GB 专用硬盘空间

存储卷的最低基础线必须被定为 1500 IOPS。

数据库

20 GB 专用硬盘空间

  • 建议大于 150 GB
  • 存储卷必须为高基线 IOPS 进行评级 (1500 或更多)。
  • 所有自动化控制器数据都存储在数据库中。通过管理的主机数量、作业运行数量、事实缓存中存储的 fact 数量以及单个作业中的任务数量,数据库存储会增加。例如,一个 playbook 在 250 个主机中每小时运行一次(一天 24 次),20 个任务每周会在数据库中存储超过 800000 个事件。
  • 如果没有为数据库保留足够空间,旧的作业和 fact 将需要定期清理。如需更多信息,请参阅自动控制器管理指南中的管理作业

PostgreSQL 配置

另外,您可以将 PostgreSQL 数据库配置为不由 Red Hat Ansible Automation Platform 安装程序管理的独立节点。当 Ansible Automation Platform 安装程序管理数据库服务器时,它会使用通常为大多数工作负载推荐的默认值配置服务器。但是,您可以调整独立数据库服务器节点的这些 PostgreSQL 设置,其中 ansible_memtotal_mb 是数据库服务器的总内存大小:

max_connections == 1024
shared_buffers == ansible_memtotal_mb*0.3
work_mem == ansible_memtotal_mb*0.03
maintenance_work_mem == ansible_memtotal_mb*0.04

其他资源

有关调整 PostgreSQL 服务器的详情,请查看 PostgreSQL 文档

2.4.1. 设置外部(客户支持)数据库

重要

红帽不支持使用外部(客户支持)数据库,但客户使用它。以下有关 inital 配置的指导只从产品安装角度提供,以避免相关的支持请求。

要在外部 PostgreSQL 兼容数据库中创建用于自动化控制器的数据库、用户和密码,请使用以下步骤。

流程

  1. 安装,然后连接到具有超级用户权限的 PostgreSQL 兼容数据库服务器。

    # psql -h <db.example.com> -U superuser -p 5432 -d postgres <Password for user superuser>:

    其中:

    -h hostname
    --host=hostname

    指定运行服务器的机器的主机名。如果该值以斜杠开头,它将用作 Unix-domain 套接字的目录。

    -d dbname
    --dbname=dbname

    指定要连接到的数据库的名称。这等同于将 dbname 指定为命令行中的第一个非选项参数。dbname 可以是连接字符串。如果是,则连接字符串参数会覆盖任何冲突的命令行选项。

    -U username
    --username=username

    以用户 用户名 而非默认值连接到数据库。(您必须有权限才能这样做。)

  2. 使用分配给用户的 createDB 或管理员角色,创建用户、数据库和密码。如需更多信息,请参阅 数据库角色
  3. 将数据库凭据和主机详情作为外部数据库添加到自动化控制器清单文件。

    以下示例中使用了默认值:

    [database]
    pg_host='db.example.com'
    pg_port=5432
    pg_database='awx'
    pg_username='awx'
    pg_password='redhat'
  4. 运行安装程序。

    如果您将 PostgreSQL 数据库与自动化控制器搭配使用,则数据库由 connect 用户所有,且必须为其分配 createDB 或管理员角色。

  5. 检查您是否能够使用用户、密码和数据库名称连接到创建的数据库。
  6. 检查用户的权限,该用户应具有 createDB 或 administrator 角色。
注意

在此过程中,您必须检查外部数据库覆盖。如需更多信息,请参阅 https://access.redhat.com/articles/4010491

2.4.2. Ansible Automation Platform PostgreSQL 数据库的基准测试存储性能

以下流程描述了如何对存储系统的写入/读取 IOPS 性能进行基准测试,以检查是否满足最低 Ansible Automation Platform PostgreSQL 数据库要求。

先决条件

  • 您已安装了 Flexible I/O Tester (fio) 存储性能基准工具。

    要安装 fio,以 root 用户身份运行以下命令:

    # yum -y install fio
  • 您有足够的磁盘空间来存储 fio 测试数据日志文件。

    该流程中显示的示例至少需要 60GB 磁盘空间在 /tmp 目录中:

    • numjobs 设置由 命令运行的作业数量。
    • size=10G 设置每个作业生成的文件大小。

    要减少测试数据的数量,请调整 size 参数的值。

流程

  1. 运行随机写入测试:

    $ fio --name=write_iops --directory=/tmp --numjobs=3 --size=10G \
    --time_based --runtime=60s --ramp_time=2s --ioengine=libaio --direct=1 \
    --verify=0 --bs=4K --iodepth=64 --rw=randwrite \
    --group_reporting=1 > /tmp/fio_benchmark_write_iops.log \
    2>> /tmp/fio_write_iops_error.log
  2. 运行随机读测试:

    $ fio --name=read_iops --directory=/tmp \
    --numjobs=3 --size=10G --time_based --runtime=60s --ramp_time=2s \
    --ioengine=libaio --direct=1 --verify=0 --bs=4K --iodepth=64 --rw=randread \
    --group_reporting=1 > /tmp/fio_benchmark_read_iops.log \
    2>> /tmp/fio_read_iops_error.log
  3. 查看结果:

    在基准命令编写的日志文件中,搜索以 iops 开头的行。此行显示测试的最小、最大值和平均值。

    以下示例显示了日志文件中随机读取测试的行:

    $ cat /tmp/fio_benchmark_read_iops.log
    read_iops: (g=0): rw=randread, bs=(R) 4096B-4096B, (W) 4096B-4096B, (T) 4096B-4096B, ioengine=libaio, iodepth=64
    […]
       iops        : min=50879, max=61603, avg=56221.33, stdev=679.97, samples=360
    […]

    您必须根据您自己的业务需求、应用程序工作负载和新需求审核、监控和重新查看日志文件。

第 3 章 安装 Red Hat Ansible Automation Platform

Ansible Automation Platform 是一个模块化平台,您可以使用其他自动化平台组件(如自动化中心)部署自动化控制器。如需有关 Ansible Automation Platform 提供的组件的更多信息,请参阅 Red Hat Ansible Automation Platform 计划指南中的 Red Hat Ansible Automation Platform 平台组件。

Red Hat Ansible Automation Platform 有很多支持的安装场景。要安装 Red Hat Ansible Automation Platform,您必须编辑 inventory 文件参数,以使用以下示例之一指定您的安装场景:

3.1. 编辑 Red Hat Ansible Automation Platform 安装程序清单文件

您可以使用 Red Hat Ansible Automation Platform 安装程序清单文件指定您的安装场景。

流程

  1. 进入安装程序:

    1. [RPM 安装的软件包]

      $ cd /opt/ansible-automation-platform/installer/
    2. [Bundled installer]

      $ cd ansible-automation-platform-setup-bundle-<latest-version>
    3. [Online installer]

      $ cd ansible-automation-platform-setup-<latest-version>
  2. 使用文本编辑器打开清单文件。
  3. 编辑清单文件参数,以指定您的安装场景。使用其中一个支持的 安装场景示例来更新清单文件。

其他资源

如需 Ansible 安装清单文件中使用的预定义变量的完整列表,请参阅清单文件变量

3.1.1. 基于安装场景的清单文件示例

红帽支持多种 Ansible Automation Platform 安装场景。查看以下示例并选择适合您首选安装场景的用户。

重要
  • Red Hat Ansible Automation Platform 或 Automation hub:在 [automationhub] 组中添加一个 Automation hub 主机。
  • 对于内部数据库: [database] 不能被用来指向 Ansible Automation Platform 集群中的另一主机。要安装的数据库主机需要是唯一的主机。
  • 对于生产环境或客户环境中的 Ansible Automation Platform 版本,不要在同一节点上安装自动化控制器和自动化中心。这可能导致争用问题和大量资源的使用。
  • [automationhub][automationcontroller] 主机提供可访问 IP 地址或完全限定域名(FQDN),以确保用户可以从不同节点从自动化中心同步和安装内容。

    FQDN 不得包含 -_ 符号,因为它无法正确处理。

    不要使用 localhost

  • 对于 forpg_password,不要使用特殊字符。可能会导致设置失败。
  • registry_usernameregistry_password 中输入 Red Hat Registry Service account 凭证以链接到 Red Hat 容器 registry。
  • 只有在使用非捆绑包安装程序时,才需要清单文件变量 registry_usernameregistry_password
3.1.1.1. 带有内部数据库的独立自动化控制器

使用本示例填充清单文件来安装 Red Hat Ansible Automation Platform。此安装清单文件包含一个带有内部数据库的自动化控制器节点。

[automationcontroller]
controller.acme.org

[all:vars]
admin_password='<password>'
pg_host=''
pg_port='5432'
pg_database='awx'
pg_username='awx'
pg_password='<password>'
pg_sslmode='prefer'  # set to 'verify-full' for client-side enforced SSL

registry_url='registry.redhat.io'
registry_username='<registry username>'
registry_password='<registry password>'


# SSL-related variables
# If set, this will install a custom CA certificate to the system trust store.
# custom_ca_cert=/path/to/ca.crt
# Certificate and key to install in nginx for the web UI and API
# web_server_ssl_cert=/path/to/tower.cert
# web_server_ssl_key=/path/to/tower.key
# Server-side SSL settings for PostgreSQL (when we are installing it).
# postgres_use_ssl=False
# postgres_ssl_cert=/path/to/pgsql.crt
# postgres_ssl_key=/path/to/pgsql.key
3.1.1.2. 带有外部(安装程序管理的)数据库的单一自动化控制器

使用本示例填充清单文件来安装 Red Hat Ansible Automation Platform。此安装清单文件包含单一自动化控制器节点,单独节点上具有外部数据库。

[automationcontroller]
controller.acme.org

[database]
data.acme.org

[all:vars]
admin_password='<password>'
pg_host='data.acme.org'
pg_port='5432'
pg_database='awx'
pg_username='awx'
pg_password='<password>'
pg_sslmode='prefer'  # set to 'verify-full' for client-side enforced SSL

registry_url='registry.redhat.io'
registry_username='<registry username>'
registry_password='<registry password>'

# SSL-related variables
# If set, this will install a custom CA certificate to the system trust store.
# custom_ca_cert=/path/to/ca.crt
# Certificate and key to install in nginx for the web UI and API
# web_server_ssl_cert=/path/to/tower.cert
# web_server_ssl_key=/path/to/tower.key
# Server-side SSL settings for PostgreSQL (when we are installing it).
# postgres_use_ssl=False
# postgres_ssl_cert=/path/to/pgsql.crt
# postgres_ssl_key=/path/to/pgsql.key
3.1.1.3. 单个带有外部的自动化控制器(客户提供)数据库

使用本示例填充清单文件来安装 Red Hat Ansible Automation Platform。此安装清单文件包含一个单独的自动化控制器节点,它带有一个在不是由平台安装程序管理的单独节点上的外部数据库。

重要

本例没有数据库组下的主机。这表示数据库已存在,并在其他位置被管理。

[automationcontroller]
controller.acme.org

[database]

[all:vars]
admin_password='<password>'

pg_host='data.acme.org'
pg_port='5432'
pg_database='awx'
pg_username='awx'
pg_password='<password>'
pg_sslmode='prefer'  # set to 'verify-full' for client-side enforced SSL

registry_url='registry.redhat.io'
registry_username='<registry username>'
registry_password='<registry password>'


# SSL-related variables
# If set, this will install a custom CA certificate to the system trust store.
# custom_ca_cert=/path/to/ca.crt
# Certificate and key to install in nginx for the web UI and API
# web_server_ssl_cert=/path/to/tower.cert
# web_server_ssl_key=/path/to/tower.key
# Server-side SSL settings for PostgreSQL (when we are installing it).
# postgres_use_ssl=False
# postgres_ssl_cert=/path/to/pgsql.crt
# postgres_ssl_key=/path/to/pgsql.key
3.1.1.4. 带有外部(安装程序管理的)数据库的 Ansible Automation Platform

使用本示例填充清单文件来安装 Ansible Automation Platform。此安装清单文件包含两个自动化控制器节点、两个执行节点,以及带有外部管理数据库的自动化中心。

# Automation Controller Nodes
# There are two valid node_types that can be assigned for this group.
# A node_type=control implies that the node will only be able to run
# project and inventory updates, but not regular jobs.
# A node_type=hybrid will have the ability to run everything.
# If you do not define the node_type, it defaults to hybrid.
#
# control.example node_type=control
# hybrid.example  node_type=hybrid
# hybrid2.example <- this will default to hybrid

[automationcontroller]
controller1.acme.org node_type=control
controller2.acme.org node_type=control

# Execution Nodes
# There are two valid node_types that can be assigned for this group.
# A node_type=hop implies that the node will forward jobs to an execution node.
# A node_type=execution implies that the node will be able to run jobs.
# If you do not define the node_type, it defaults to execution.
#
# hop.example node_type=hop
# execution.example  node_type=execution
# execution2.example <- this will default to execution

[execution_nodes]
execution1.acme.org node_type=execution
execution2.acme.org node_type=execution

[automationhub]
automationhub.acme.org

[database]
data.acme.org

[all:vars]
admin_password='<password>'
pg_host='data.acme.org'
pg_port='5432'
pg_database='awx'
pg_username='awx'
pg_password='<password>'
pg_sslmode='prefer'  # set to 'verify-full' for client-side enforced SSL

registry_url='registry.redhat.io'
registry_username='<registry username>'
registry_password='<registry password>'

# Receptor Configuration
#
receptor_listener_port=27199

# Automation Hub Configuration
#
automationhub_admin_password='<password>'
automationhub_pg_host='data.acme.org'
automationhub_pg_port='5432'
automationhub_pg_database='automationhub'
automationhub_pg_username='automationhub'
automationhub_pg_password='<password>'
automationhub_pg_sslmode='prefer'

# The default install will deploy a TLS enabled Automation Hub.
# If for some reason this is not the behavior wanted one can
# disable TLS enabled deployment.
#
# automationhub_disable_https = False
# The default install will generate self-signed certificates for the Automation
# Hub service. If you are providing valid certificate via automationhub_ssl_cert
# and automationhub_ssl_key, one should toggle that value to True.
#
# automationhub_ssl_validate_certs = False
# SSL-related variables
# If set, this will install a custom CA certificate to the system trust store.
# custom_ca_cert=/path/to/ca.crt
# Certificate and key to install in nginx for the web UI and API
# web_server_ssl_cert=/path/to/tower.cert
# web_server_ssl_key=/path/to/tower.key
# Certificate and key to install in Automation Hub node
# automationhub_ssl_cert=/path/to/automationhub.cert
# automationhub_ssl_key=/path/to/automationhub.key
# Server-side SSL settings for PostgreSQL (when we are installing it).
# postgres_use_ssl=False
# postgres_ssl_cert=/path/to/pgsql.crt
# postgres_ssl_key=/path/to/pgsql.key
3.1.1.5. 带有外部(客户提供的)数据库的 Ansible Automation Platform

使用本示例填充清单文件来安装 Red Hat Ansible Automation Platform。此安装清单文件包括每个节点类型之一:control、hybrid、hop 和 execution,以及带有不由平台安装程序管理的外部管理数据库的自动化中心。

重要

本例没有数据库组下的主机。这表示数据库已存在,并在其他位置被管理。

# Automation Controller Nodes
# There are two valid node_types that can be assigned for this group.
# A node_type=control implies that the node will only be able to run
# project and inventory updates, but not regular jobs.
# A node_type=hybrid will have the ability to run everything.
# If you do not define the node_type, it defaults to hybrid.
#
# control.example node_type=control
# hybrid.example  node_type=hybrid
# hybrid2.example <- this will default to hybrid

[automationcontroller]
hybrid1.acme.org node_type=hybrid
controller1.acme.org node_type=control

# Execution Nodes
# There are two valid node_types that can be assigned for this group.
# A node_type=hop implies that the node will forward jobs to an execution node.
# A node_type=execution implies that the node will be able to run jobs.
# If you do not define the node_type, it defaults to execution.
#
# hop.example node_type=hop
# execution.example  node_type=execution
# execution2.example <- this will default to execution

[execution_nodes]
hop1.acme.org node_type=hop
execution1.acme.org node_type=execution

[automationhub]
automationhub.acme.org

[database]

[all:vars]
admin_password='<password>'
pg_host='data.acme.org'
pg_port='5432'
pg_database='awx'
pg_username='awx'
pg_password='<password>'
pg_sslmode='prefer'  # set to 'verify-full' for client-side enforced SSL

registry_url='registry.redhat.io'
registry_username='<registry username>'
registry_password='<registry password>'

# Receptor Configuration
#
receptor_listener_port=27199

# Automation Hub Configuration
#
automationhub_admin_password='<password>'
automationhub_pg_host='data.acme.org'
automationhub_pg_port='5432'
automationhub_pg_database='automationhub'
automationhub_pg_username='automationhub'
automationhub_pg_password='<password>'
automationhub_pg_sslmode='prefer'

# The default install will deploy a TLS enabled Automation Hub.
# If for some reason this is not the behavior wanted one can
# disable TLS enabled deployment.
#
# automationhub_disable_https = False
# The default install will generate self-signed certificates for the Automation
# Hub service. If you are providing valid certificate via automationhub_ssl_cert
# and automationhub_ssl_key, one should toggle that value to True.
#
# automationhub_ssl_validate_certs = False
# SSL-related variables
# If set, this will install a custom CA certificate to the system trust store.
# custom_ca_cert=/path/to/ca.crt
# Certificate and key to install in nginx for the web UI and API
# web_server_ssl_cert=/path/to/tower.cert
# web_server_ssl_key=/path/to/tower.key
# Certificate and key to install in Automation Hub node
# automationhub_ssl_cert=/path/to/automationhub.cert
# automationhub_ssl_key=/path/to/automationhub.key
# Server-side SSL settings for PostgreSQL (when we are installing it).
# postgres_use_ssl=False
# postgres_ssl_cert=/path/to/pgsql.crt
# postgres_ssl_key=/path/to/pgsql.key
3.1.1.6. 带有内部数据库的独立自动化中心

使用本例填充清单文件,以使用内部数据库部署独立自动化中心实例。

[automationcontroller]


[automationhub]
automationhub.acme.org ansible_connection=local

[all:vars]
registry_url='registry.redhat.io'
registry_username='<registry username>'
registry_password='<registry password>'

automationhub_admin_password= <PASSWORD>

automationhub_pg_host=''
automationhub_pg_port='5432'

automationhub_pg_database='automationhub'
automationhub_pg_username='automationhub'
automationhub_pg_password=<PASSWORD>
automationhub_pg_sslmode='prefer'

# The default install will deploy a TLS enabled Automation Hub.
# If for some reason this is not the behavior wanted one can
# disable TLS enabled deployment.
#
# automationhub_disable_https = False
# The default install will generate self-signed certificates for the Automation
# Hub service. If you are providing valid certificate via automationhub_ssl_cert
# and automationhub_ssl_key, one should toggle that value to True.
#
# automationhub_ssl_validate_certs = False
# SSL-related variables
# If set, this will install a custom CA certificate to the system trust store.
# custom_ca_cert=/path/to/ca.crt
# Certificate and key to install in Automation Hub node
# automationhub_ssl_cert=/path/to/automationhub.cert
# automationhub_ssl_key=/path/to/automationhub.key
3.1.1.7. 带有外部(安装程序管理的)数据库的单一自动化中心

使用本示例填充清单文件,以使用外部(安装程序管理)数据库部署单一自动化中心实例。

[automationcontroller]

[automationhub]
automationhub.acme.org

[database]
data.acme.org

[all:vars]
registry_url='registry.redhat.io'
registry_username='<registry username>'
registry_password='<registry password>'

automationhub_admin_password= <PASSWORD>

automationhub_pg_host='data.acme.org'
automationhub_pg_port='5432'

automationhub_pg_database='automationhub'
automationhub_pg_username='automationhub'
automationhub_pg_password=<PASSWORD>
automationhub_pg_sslmode='prefer'

# The default install will deploy a TLS enabled Automation Hub.
# If for some reason this is not the behavior wanted one can
# disable TLS enabled deployment.
#
# automationhub_disable_https = False
# The default install will generate self-signed certificates for the Automation
# Hub service. If you are providing valid certificate via automationhub_ssl_cert
# and automationhub_ssl_key, one should toggle that value to True.
#
# automationhub_ssl_validate_certs = False
# SSL-related variables
# If set, this will install a custom CA certificate to the system trust store.
# custom_ca_cert=/path/to/ca.crt
# Certificate and key to install in Automation Hub node
# automationhub_ssl_cert=/path/to/automationhub.cert
# automationhub_ssl_key=/path/to/automationhub.key
3.1.1.8. 带有外部(客户提供的)数据库的单一自动化中心

使用本示例填充清单文件,部署一个单独的自动化中心实例,它带有一个不是由平台安装程序管理的数据中心。

重要

本例没有数据库组下的主机。这表示数据库已存在,并在其他位置被管理。

[automationcontroller]

[automationhub]
automationhub.acme.org

[database]

[all:vars]
registry_url='registry.redhat.io'
registry_username='<registry username>'
registry_password='<registry password>'

automationhub_admin_password= <PASSWORD>

automationhub_pg_host='data.acme.org'
automationhub_pg_port='5432'

automationhub_pg_database='automationhub'
automationhub_pg_username='automationhub'
automationhub_pg_password=<PASSWORD>
automationhub_pg_sslmode='prefer'

# The default install will deploy a TLS enabled Automation Hub.
# If for some reason this is not the behavior wanted one can
# disable TLS enabled deployment.
#
# automationhub_disable_https = False
# The default install will generate self-signed certificates for the Automation
# Hub service. If you are providing valid certificate via automationhub_ssl_cert
# and automationhub_ssl_key, one should toggle that value to True.
#
# automationhub_ssl_validate_certs = False
# SSL-related variables
# If set, this will install a custom CA certificate to the system trust store.
# custom_ca_cert=/path/to/ca.crt
# Certificate and key to install in Automation Hub node
# automationhub_ssl_cert=/path/to/automationhub.cert
# automationhub_ssl_key=/path/to/automationhub.key
3.1.1.9. 私有自动化中心上的 LDAP 配置

您必须在 Red Hat Ansible Automation Platform 安装程序清单文件中设置以下六个变量,以配置用于 LDAP 身份验证的私有自动化中心:

  • automationhub_authentication_backend
  • automationhub_ldap_server_uri
  • automationhub_ldap_bind_dn
  • automationhub_ldap_bind_password
  • automationhub_ldap_user_search_base_dn
  • automationhub_ldap_group_search_base_dn

如果缺少其中的任何变量,Ansible Automation 安装程序将无法完成安装。

3.1.1.9.1. 设置清单文件变量

当使用 LDAP 身份验证配置私有自动化中心时,您必须在安装过程中在清单文件中设置正确的变量。

流程

  1. 根据编辑 Red Hat Ansible Automation Platform 安装程序清单文件中的步骤访问您的清单文件。
  2. 使用以下示例来设置 Ansible Automation Platform 清单文件:

    automationhub_authentication_backend = "ldap"
    
    automationhub_ldap_server_uri = "ldap://ldap:389"   (for LDAPs use  automationhub_ldap_server_uri = "ldaps://ldap-server-fqdn")
    automationhub_ldap_bind_dn = "cn=admin,dc=ansible,dc=com"
    automationhub_ldap_bind_password = "GoodNewsEveryone"
    automationhub_ldap_user_search_base_dn = "ou=people,dc=ansible,dc=com"
    automationhub_ldap_group_search_base_dn = "ou=people,dc=ansible,dc=com"
    注意

    以下变量将使用默认值设置,除非您使用其他选项进行了设置。

    auth_ldap_user_search_scope= 'SUBTREE'
    auth_ldap_user_search_filter= '(uid=%(user)s)'
    auth_ldap_group_search_scope= 'SUBTREE'
    auth_ldap_group_search_filter= '(objectClass=Group)'
    auth_ldap_group_type_class= 'django_auth_ldap.config:GroupOfNamesType'
  3. 可选:在私有自动化中心中设置额外的参数,如用户组、超级用户访问或镜像。前往 配置额外的 LDAP 参数 以完成此可选步骤。
3.1.1.9.2. 配置额外的 LDAP 参数

如果您计划设置超级用户访问权限、用户组、镜像或其他额外参数,您可以创建一个在 ldap_extra_settings 字典中组成它们的 YAML 文件。

流程

  1. 创建一个包含 ldap_extra_settings 的 YAML 文件。

    • Example:

      #ldapextras.yml
      ---
      ldap_extra_settings:
       <LDAP_parameter>: <Values>
      
      ...
  2. 添加设置所需的任何参数。以下示例描述了您可以在 ldap_extra_settings 中设置的 LDAP 参数:

    • 使用本示例根据 LDAP 组中的成员资格设置超级用户标志。

      #ldapextras.yml
      ---
      ldap_extra_settings:
        AUTH_LDAP_USER_FLAGS_BY_GROUP: {"is_superuser": "cn=pah-admins,ou=groups,dc=example,dc=com",}
      ...
    • 使用本示例设置超级用户访问权限。

      #ldapextras.yml
      ---
      ldap_extra_settings:
        AUTH_LDAP_USER_FLAGS_BY_GROUP: {"is_superuser": "cn=pah-admins,ou=groups,dc=example,dc=com",}
      ...
    • 使用本示例来镜像(mirror)您属于的所有 LDAP 组。

      #ldapextras.yml
      ---
      ldap_extra_settings:
        AUTH_LDAP_MIRROR_GROUPS: True
      ...
    • 使用本示例映射 LDAP 用户属性(如用户名、姓氏和电子邮件地址)。

      #ldapextras.yml
      ---
      ldap_extra_settings:
        AUTH_LDAP_USER_ATTR_MAP: {"first_name": "givenName", "last_name": "sn", "email": "mail",}
      ...
    • 使用以下示例根据 LDAP 组成员资格授予或拒绝访问权限:

      • 要授予私有自动化中心访问权限(例如,cn=pah-nosoupforyou,ou=groups,dc=example,dc=com 组的成员):

        #ldapextras.yml
        ---
        ldap_extra_settings:
          AUTH_LDAP_REQUIRE_GROUP: 'cn=pah-nosoupforyou,ou=groups,dc=example,dc=com'
        ...
      • 拒绝私有自动化中心访问(例如,cn=pah-nosoupforyou,ou=groups,dc=example,dc=com 组的成员):

        #ldapextras.yml
        ---
        ldap_extra_settings:
          AUTH_LDAP_REQUIRE_GROUP: 'cn=pah-nosoupforyou,ou=groups,dc=example,dc=com'
        ...
    • 使用本示例启用 LDAP 调试日志记录。

      #ldapextras.yml
      ---
      ldap_extra_settings:
        GALAXY_LDAP_LOGGING: True
      ...
      注意

      如果重新运行 setup.sh 或在短时间内启用了调试日志,则可以将包含 GALAXY_LDAP_LOGGING: True 的行手动添加到私有自动化中心上的 /etc/pulp/settings.py 文件。重启 pulpcore-api.servicenginx.service 以使更改生效。为了避免因为人为错误而失败,请仅在需要时使用此方法。

    • 通过设置变量 AUTH_LDAP_CACHE_TIMEOUT,使用本示例配置 LDAP 缓存。

      #ldapextras.yml
      ---
      ldap_extra_settings:
        AUTH_LDAP_CACHE_TIMEOUT: 3600
      ...
  3. 在私有自动化中心安装过程中运行 setup.sh -e @ldapextras.yml。验证您已正确设置,请确认您可以在私有自动化中心上的 /etc/pulp/settings.py 文件中查看所有设置。

3.2. 运行 Red Hat Ansible Automation Platform 安装程序设置脚本

在您使用用于安装您的私有自动化中心所需的参数更新了清单文档后,运行安装程序设置脚本。

流程

  • 运行 setup.sh 脚本

    $ sudo ./setup.sh

安装 Red Hat Ansible Automation Platform 将开始。

3.3. 验证自动化控制器的安装

使用您插入到清单文件中的 admin 凭据登录来验证您是否已成功安装自动化控制器。

流程

  1. 进入清单文件中为自动化控制器节点指定的 IP 地址。
  2. 使用您在清单文件中设置的 Admin 凭据登录。
注意

自动化控制器服务器可从端口 80 (https://<CONTROLLER_SERVER_NAME>/)访问,但会重定向到端口 443,因此端口 443 必须可用。

重要

如果安装失败,且您购买了 Red Hat Ansible Automation Platform 的有效许可证,请通过红帽客户门户网站联络 Ansible。

当可以成功登录到自动化控制器后,则代表您的 Red Hat Ansible Automation Platform 2.3 安装已完成。

3.3.1. 其他自动化控制器配置和资源

请参阅以下资源来探索其他自动化控制器配置。

表 3.1. 配置自动化控制器的资源
资源链接描述

自动化控制器快速设置指南

设置自动化控制器并运行第一个 playbook

自动化控制器管理指南

通过客户脚本、管理作业等配置自动化控制器管理。

配置 Red Hat Ansible Automation Platform 的代理支持

使用代理服务器设置自动化控制器

从自动化控制器管理可用性分析和数据收集

管理您与红帽共享的自动化控制器信息

自动化控制器用户指南

更详细地查看自动化控制器功能

3.4. 验证自动化中心安装

使用您插入到清单文件中的 admin 凭证登录来验证您是否已成功安装了自动化中心。

流程

  1. 进入清单文件中为自动化中心节点指定的 IP 地址。
  2. 使用您在清单文件中设置的 Admin 凭据登录。
重要

如果安装失败,且您购买了 Red Hat Ansible Automation Platform 的有效许可证,请通过红帽客户门户网站联络 Ansible。

如果可以成功登录到自动化中心,则代表您的 Red Hat Ansible Automation Platform 2.3 安装已完成。

3.4.1. 其他自动化中心配置和资源

请参阅以下资源来探索额外的自动化中心配置。

表 3.2. 配置自动化控制器的资源
资源链接描述

在私有自动化 hub 中管理用户访问权限

为自动化 hub 配置用户访问

在自动 Hub 中管理红帽认证的集合和 Ansible Galaxy 集合

在自动化 hub 中添加内容

在自动化 hub 中发布专有内容集合

在自动化 hub 中发布内部开发的集合

3.5. 安装后的步骤

无论您是希望开始使用自动化的新 Ansible Automation Platform 用户,还是希望将旧的 Ansible 内容迁移到最新版本的 Red Hat Ansible Automation Platform,充分利用 Ansible Automation Platform 2.3 的新功能:

3.5.1. 将数据迁移到 Ansible Automation Platform 2.3

对于希望完成升级到 Ansible Automation Platform 2.3 的平台管理员,可能需要额外步骤将数据迁移到新实例:

3.5.1.1. 从旧的虚拟环境 (venvs) 迁移到自动化执行环境

通过 Ansible Automation Platform 2.3,您可以从自定义 Python 虚拟环境 (venvs) 转换为使用自动化执行环境 - 它是容器化镜像,包括了执行和扩展 Ansible 自动化所需的组件。这包括 Ansible Core、Ansible 内容集合、Python 依赖项、Red Hat Enterprise Linux UBI 8 以及任何其他软件包依赖项。

如果您希望将 venvs 迁移到执行环境,则需要(1)使用 awx-manage 命令列出并从原始实例中导出 venvs 列表,然后(2)使用 ansible-builder 创建执行环境。

3.5.1.2. 使用 Ansible Builder 迁移至 Ansible Engine 2.9 镜像

要迁移 Ansible Engine 2.9 镜像以用于 Ansible Automation Platform 2.3,ansible-builder 工具会自动重建镜像(包括其自定义插件和依赖项)的过程,供自动化执行环境使用。

其他资源

有关使用 Ansible Builder 构建执行环境的更多信息,请参阅创建和恢复执行环境

3.5.1.3. 迁移到 Ansible Core 2.13

升级到 Ansible Core 2.13 时,您需要更新您的 playbook、插件或其他 Ansible 基础架构的一部分,以便由最新版本的 Ansible Core 支持。有关更新 Ansible Core 2.13 兼容性的步骤,请参阅 Ansible 内核 2.13 端口指南

3.5.2. 更新执行环境镜像位置

如果单独安装私有自动化中心,您可以更新您的执行环境镜像位置,以指向您的私有自动化中心。使用这个流程更新您的执行环境镜像位置。

流程

  1. 进入包含 setup.sh的目录
  2. 运行以下命令来创建 ./group_vars/automationcontroller

    touch ./group_vars/automationcontroller
  3. 将以下内容粘贴到 ./group_vars/automationcontroller 中,确保调整设置以适应您的环境:

    # Automation Hub Registry
    registry_username: 'your-automation-hub-user'
    registry_password: 'your-automation-hub-password'
    registry_url: 'automationhub.example.org'
    registry_verify_ssl: False
    
    ## Execution Environments
    control_plane_execution_environment: 'automationhub.example.org/ee-supported-rhel8:latest'
    
    global_job_execution_environments:
      - name: "Default execution environment"
        image: "automationhub.example.org/ee-supported-rhel8:latest"
      - name: "Ansible Engine 2.9 execution environment"
        image: "automationhub.example.org/ee-29-rhel8:latest"
      - name: "Minimal execution environment"
        image: "automationhub.example.org/ee-minimal-rhel8:latest"
  4. 运行 ./setup.sh 脚本

    $ ./setup.sh

验证

  1. 以具有系统管理员访问权限的用户身份登录 Ansible Automation Platform。
  2. 进入到 AdministrationExecution Environments
  3. 在 Image 列中,确认执行环境镜像位置已从默认值 <registry url>/ansible-automation-platform-<version>/<image name>:<tag> 改为 <automation hub url>/<image name>:<tag>

3.5.3. 使用自动化网格扩展自动化

Red Hat Ansible Automation Platform 的自动化网格组件简化了在多站点部署之间分布自动化的过程。对于具有多个隔离的 IT 环境的企业,自动化网格提供了一个一致且可靠的方法,使用对等对网格通信网络在执行节点上部署和扩展自动化。

当从版本 1.x 升级到最新版本的 Ansible Automation Platform 时,您需要将旧隔离节点中的数据迁移到自动化网格所需的执行节点。您可以通过规划混合和控制节点网络来实施自动化中心,然后编辑 Ansible Automation Platform 安装程序中找到的清单文件,为每个执行节点分配与网格相关的值。

有关如何从隔离节点迁移到执行节点的说明,请参阅 Red Hat Ansible Automation Platform 升级和迁移指南

有关自动化网格以及为您的环境设计自动化网格的各种方法的信息,请参阅 Red Hat Ansible Automation Platform Automation mesh

第 4 章 断开连接的安装

4.1. 在断开连接的 RHEL 上安装 Ansible Automation Platform

安装 Ansible Automation Platform 自动化控制器和私有自动化中心,它带有一个位于自动化控制器中的安装程序管理的数据库,而无需互联网连接。

4.1.1. 先决条件

要在断开连接的网络中安装 Ansible Automation Platform,请完成以下先决条件:

  • 创建订阅清单。
  • 下载 Ansible Automation Platform 安装捆绑包。
  • 为自动化控制器和私有自动化中心服务器创建 DNS 记录。
注意

安装捆绑包包含可在断开连接的环境中安装 Ansible Automation Platform 的其他组件。这包括 Ansible Automation Platform RPM 和默认执行环境(EE)镜像。

4.1.2. 系统要求

硬件要求包括在 Automation Platform 安装指南中。请参阅 Ansible Automation Platform 版本的 Ansible Automation Platform 产品文档中的 "Red Hat Ansible Automation Platform 安装指南"。

4.1.3. RPM 源

来自 BaseOS 和 AppStream 存储库的 Ansible Automation Platform 的 RPM 依赖项没有包括在安装捆绑包中。要添加这些依赖项,您必须获取 BaseOS 和 AppStream 软件仓库的访问权限。

  • Satellite 是推荐的红帽同步软件仓库的方法
  • reposync - 制作所需的 RPM 仓库的完整副本,并将它们托管在断开连接的网络中
  • RHEL Binary DVD - 使用 RHEL 8 Binary DVD 中的 RPM
注意

RHEL Binary DVD 方法需要 DVD 支持的 RHEL 8.4 或更高版本。有关当前支持哪些 RHEL 版本的详情,请查看 Red Hat Enterprise Linux 生命周期

4.2. 使用 reposync 同步 RPM 仓库

要执行 reposync,您需要一个可以访问互联网的 RHEL 主机。同步仓库后,您可以将仓库移到从 Web 服务器托管的断开连接的网络中。

流程

  1. 附加 BaseOS 和 AppStream 所需的软件仓库:

    # subscription-manager repos \
        --enable rhel-8-for-x86_64-baseos-rpms \
        --enable rhel-8-for-x86_64-appstream-rpms
  2. 执行 reposync :

    # dnf install yum-utils
    # reposync -m --download-metadata --gpgcheck \
        -p /path/to/download
    1. 请确定您在使用 reposync 时带有 --download-metadata 且没有 --newest-only。请参阅 [RHEL 8] Reposync.
    2. 如果没有使用 --newest-only,则下载的仓库大小约为 ~90GB。
    3. 如果使用 --newest-only,则下载的仓库大小约为 ~14GB。
  3. 如果您计划使用 Red Hat Single Sign-On (RHSSO),则需要同步这些仓库。

    1. jb-eap-7.3-for-rhel-8-x86_64-rpms
    2. rh-sso-7.4-for-rhel-8-x86_64-rpms
  4. 在 reposync 完成后,您的软件仓库就可以与 web 服务器一起使用。
  5. 将仓库移到断开连接的网络中。

4.3. 创建新的 Web 服务器以托管仓库

如果您没有现有的 Web 服务器来托管您的仓库,请使用同步的仓库创建一个。

流程

如果创建新的 Web 服务器,请使用以下步骤。

  1. 安装先决条件:

    $ sudo dnf install httpd
  2. 将 httpd 配置为提供 repo 目录:

    /etc/httpd/conf.d/repository.conf
    
    DocumentRoot '/path/to/repos'
    
    <LocationMatch "^/+$">
        Options -Indexes
        ErrorDocument 403 /.noindex.html
    </LocationMatch>
    
    <Directory '/path/to/repos'>
        Options All Indexes FollowSymLinks
        AllowOverride None
        Require all granted
    </Directory>
  3. 确保 apache 用户可读该目录:

    $ sudo chown -R apache /path/to/repos
  4. 配置 SELinux:

    $ sudo semanage fcontext -a -t httpd_sys_content_t "/path/to/repos(/.*)?"
    $ sudo restorecon -ir /path/to/repos
  5. 启用 httpd :

    $ sudo systemctl enable --now httpd.service
  6. 打开防火墙:

    $ sudo firewall-cmd --zone=public --add-service=http –add-service=https
    --permanent
    $ sudo firewall-cmd --reload
  7. 在自动化控制器和自动化中心中,在 /etc/yum.repos.d/local.repo 中添加一个仓库文件(如果需要,请添加可选的仓库):

    [Local-BaseOS]
    name=Local BaseOS
    baseurl=http://<webserver_fqdn>/rhel-8-for-x86_64-baseos-rpms
    enabled=1
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
    
    [Local-AppStream]
    name=Local AppStream
    baseurl=http://<webserver_fqdn>/rhel-8-for-x86_64-appstream-rpms
    enabled=1
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

4.4. 访问用于本地挂载的 DVD 的 RPM 仓库

如果您要从 DVD 访问仓库,则需要设置本地仓库。本节演示了如何进行此操作。

流程

  1. 挂载 DVD 或者 ISO

    1. DVD

      # mkdir /media/rheldvd && mount /dev/sr0 /media/rheldvd
    2. ISO

      # mkdir /media/rheldvd && mount -o loop rhrhel-8.6-x86_64-dvd.iso /media/rheldvd
  2. /etc/yum.repos.d/dvd.repo 中创建 yum repo 文件

    [dvd-BaseOS]
    name=DVD for RHEL - BaseOS
    baseurl=file:///media/rheldvd/BaseOS
    enabled=1
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
    
    [dvd-AppStream]
    name=DVD for RHEL - AppStream
    baseurl=file:///media/rheldvd/AppStream
    enabled=1
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
  3. 导入 gpg 密钥

    # rpm --import /media/rheldvd/RPM-GPG-KEY-redhat-release
注意

如果没有导入密钥,您将看到类似如下的错误

# Curl error (6): Couldn't resolve host name for
https://www.redhat.com/security/data/fd431d51.txt [Could not resolve host:
www.redhat.com]

要设置仓库,请参阅需要在 Red Hat Enterprise Linux 8 中为本地挂载的 DVD 设置 yum 软件仓库

4.5. 在没有互联网连接的 Ansible Automation Platform 中添加订阅清单

要在没有互联网连接的 Ansible Automation Platform 中添加订阅,请创建并导入订阅清单。

流程

  1. 登录到 access.redhat.com
  2. 进入到 SubscriptionsSubscriptions
  3. Subscription Allocations
  4. Create New subscription allocation
  5. 命名新的订阅分配。
  6. 选择 Satellite 6.14Satellite 6.14 作为类型。
  7. Create。Details 选项卡将为您的订阅分配打开。
  8. Subscriptions 选项卡。
  9. Add Subscription
  10. 在 Entitlements 框中找到 Ansible Automation Platform 订阅,添加 您要分配给您的环境的权利数量。由 Ansible Automation Platform 管理的每个节点都需要一个权利:服务器、网络设备等。
  11. Submit
  12. Export Manifest
  13. 这会下载在安装后使用自动化控制器导入的文件 manifest_<allocation name>_<date>.zip

4.6. 安装 Ansible Automation Platform 设置捆绑包

对于断开连接的安装,强烈建议使用 "bundle" 版本,因为它附带了 Ansible Automation Platform 的 RPM 内容,以及在安装过程中上传到私有自动化中心的默认执行环境镜像。

4.6.1. 下载设置捆绑包

流程

  1. 进入 https://access.redhat.com/downloads/content/480 并点 Download Now for the Ansible Automation Platform 2.3 Setup Bundle 下载 Ansible Automation Platform setup 捆绑包软件包。
4.6.1.1. 安装 Setup 捆绑包

安装捆绑包的下载和安装需要位于自动化控制器中。在自动化控制器中,解压缩捆绑包,编辑清单文件并运行设置。

  1. 解压捆绑包

    $ tar xvf \
       ansible-automation-platform-setup-bundle-2.3-1.2.tar.gz
    $ cd ansible-automation-platform-setup-bundle-2.3-1.2
  2. 编辑清单文件使其包含所需选项

    1. automationcontroller 组
    2. automationhub 组
    3. admin_password
    4. pg_password
    5. automationhub_admin_password
    6. automationhub_pg_host, automationhub_pg_port
    7. automationhub_pg_password

      清单示例

      [automationcontroller]
      automationcontroller.example.org ansible_connection=local
      
      [automationcontroller:vars]
      peers=execution_nodes
      
      [automationhub]
      automationhub.example.org
      
      [all:vars]
      admin_password='password123'
      
      pg_database='awx'
      pg_username='awx'
      pg_password='dbpassword123'
      
      receptor_listener_port=27199
      
      automationhub_admin_password='hubpassword123'
      
      automationhub_pg_host='automationcontroller.example.org'
      automationhub_pg_port='5432'
      
      automationhub_pg_database='automationhub'
      automationhub_pg_username='automationhub'
      automationhub_pg_password='dbpassword123'
      automationhub_pg_sslmode='prefer'
      注意

      清单应该在安装后保持不变,因为它用于备份、恢复和升级功能。如果清单文件包含密码,请考虑将备份副本保留在安全位置。

  3. 以 root 用户身份运行 AAP setup 捆绑包可执行文件

    $ sudo -i
    # cd /path/to/ansible-automation-platform-setup-bundle-2.3-1.2
    # ./setup.sh
  4. 安装完成后,进入安装清单文件中指定的自动化控制器节点的 Fully Qualified Domain Name (FQDN)。
  5. 使用安装清单文件中指定的管理员凭证登录。

4.7. 完成安装后任务

4.7.1. 添加自动化控制器订阅

流程

  1. 进入 Automation 控制器的 FQDN。使用您在清单文件中的 admin_password 指定的密码登录。
  2. Browse,再选择您之前创建的 manifest.zip
  3. 点击 Next
  4. 取消选择 User analyticsAutomation analytics。它们需要互联网连接,应该被关闭。
  5. 点击 Next
  6. 阅读最终用户许可证协议,如果同意,点 Submit

4.7.2. 更新 CA 信任存储

4.7.2.1. 自签名证书

默认情况下,自动化中心和自动化控制器使用自签名证书安装。这会造成一个问题,自动化控制器不信任自动化中心的证书,且不会从自动化中心下载执行环境。该解决方案是将自动化中心的 CA 证书导入为自动化控制器上的可信证书。您可以使用 SCP 或直接从一个文件复制并粘贴到另一个文件中来执行此操作。以下步骤从位于 https://access.redhat.com/solutions/6707451 的 KB 文章中复制。

4.7.2.2. 使用安全副本 (SCP) 将私有自动化中心中的 root 证书复制到自动化控制器中

如果 SSH 作为自动化控制器和私有自动化中心之间的 root 用户提供,请使用 SCP 将私有自动化中心上的 root 证书复制到自动化控制器,并在自动化控制器上运行 update-ca-trust 来更新 CA 信任存储。

在 Automation 控制器中

$ sudo -i
# scp <hub_fqdn>:/etc/pulp/certs/root.crt
/etc/pki/ca-trust/source/anchors/automationhub-root.crt
# update-ca-trust
4.7.2.3. 复制和暂停

如果 SSH 在私有自动化中心和自动化控制器之间不可用,请将文件 /etc/pulp/certs/root.crt 复制到名为 /etc/pki/ca-trust/source/anchors/automationhub-root.crt 的自动化控制器上的新文件,并将其粘贴到名为 /etc/pki/ca-trust/source/anchors/automationhub-root.crt 的自动化控制器上的新文件。创建新文件后,运行 update-ca-trust 命令以使用新证书更新 CA 信任存储。

在私有自动化中心中

$ sudo -i
# cat /etc/pulp/certs/root.crt
(copy the contents of the file, including the lines with 'BEGIN CERTIFICATE' and
'END CERTIFICATE')

在自动化控制器中

$ sudo -i
# vi /etc/pki/ca-trust/source/anchors/automationhub-root.crt
(paste the contents of the root.crt file from the {PrivateHubName} into the new file and write to disk)
# update-ca-trust

4.8. 将集合导入到私有 Automation Hub

您可以从以下源下载集合 tarball 文件:

4.8.1. 从 Red Hat Automation Hub 下载集合

本节介绍了如何从 Red Hat Automation Hub 下载集合。如果集合具有依赖项,则还需要下载并安装它们。

流程

  1. 进入 https://console.redhat.com/ansible/automation-hub/ 并使用您的红帽凭证登录。
  2. 点您要下载的集合
  3. Download tarball
  4. 要验证集合是否有依赖项,请点 Dependencies 选项卡。
  5. 下载此集合所需的所有依赖项。

4.9. 创建集合命名空间

集合的命名空间必须存在,才能成功导入。您可以通过查看集合 tarball filename 的第一个部分来查找命名空间名称。例如,集合 ansible-netcommon-3.0.0.tar.gz 的命名空间是 ansible

流程

  1. 登录到私有自动化中心 web 控制台。
  2. 进入 CollectionsNamespaces
  3. Create
  4. 提供命名空间名称。
  5. Create

4.9.1. 使用 GUI 导入集合 tarball

  1. 登录到私有自动化中心 web 控制台。
  2. 进入 CollectionsNamespaces
  3. 点您要将集合导入到的命名空间的 View 集合
  4. Upload collection
  5. 文件夹图标并选择集合的 tarball。
  6. Upload

这将打开"我的导入"页面。您可以查看导入的状态,以及导入的文件和模块的各种详情。

4.9.1.1. 在 CLI 中使用 ansible-galaxy 导入集合 tarball

您可以使用命令行界面而不是 GUI 将集合导入到私有自动化中心。

  1. 将集合 tarball 复制到私有自动化中心。
  2. 通过 SSH 登录到私有自动化中心服务器。
  3. 将自签名 root CA 证书添加到自动化中心的信任存储中。

    # cp /etc/pulp/certs/root.crt \
        /etc/pki/ca-trust/source/anchors/automationhub-root.crt
    # update-ca-trust
  4. 使用 hub 配置更新 /etc/ansible/ansible.cfg 文件。使用令牌或用户名和密码进行身份验证。

    [galaxy]
    server_list = private_hub
    
    [galaxy_server.private_hub]
    url=https://<hub_fqdn>/api/galaxy/
    token=<token_from_private_hub>
  5. 使用 ansible-galaxy 命令导入集合。
$ ansible-galaxy collection publish <collection_tarball>
注意

创建集合前面属于的命名空间,或发布集合将失败。

4.10. 批准导入的集合

使用 GUI 或 CLI 方法导入集合后,您必须使用 GUI 批准它们。批准后,就可以使用。

流程

  1. 登录到私有自动化中心 web 控制台。
  2. 进入 CollectionsApproval
  3. 对于您要批准的集合,点 Approve
  4. 这个集合现在可用于您的私有自动化中心。
注意

无论源是什么,集合都会被添加到 "Published" 仓库中。

  1. 使用相同的步骤为集合导入所有依赖项。

推荐的集合取决于您的用例。Ansible 和红帽提供 这些集合。

4.10.1. 自定义虚拟环境

使用 ansible-builder 程序创建自定义执行环境镜像。对于断开连接的环境,可以采用以下方法构建自定义 EE 镜像:

  • 在面向互联网的系统上构建 EE 镜像,并将其导入到断开连接的环境中
  • 完全在断开连接的环境中构建 EE 镜像,并对使用 ansible-builder 的普通流程进行一些修改
  • 创建一个最小基础容器镜像,其中包含在断开连接的环境中的所有必要修改,然后从基础容器镜像构建自定义 EE 镜像
4.10.1.1. 在未连接的 Boundary 中传输自定义 EE 镜像

自定义执行环境镜像可以使用现有的文档在面向互联网的机器上构建。创建执行环境后,就可以在本地 Podman 镜像缓存中使用。然后,您可以在断开连接的边界之间传输自定义 EE 镜像。要在断开连接的边界间传输自定义 EE 镜像,首先保存镜像:

  1. 保存镜像:
$ podman image save localhost/custom-ee:latest | gzip -c custom-ee-latest.tar.gz

使用现有机制(如 sneakernet、单向 diode 等)在断开连接的边界间传输文件。当镜像在断开连接的环境中可用后,将其导入到本地 podman 缓存,标记它并将其推送到断开连接的 hub 中:

$ podman image load -i custom-ee-latest.tar.gz
$ podman image tag localhost/custom-ee <hub_fqdn>/custom-ee:latest
$ podman login <hub_fqdn> --tls-verify=false
$ podman push <hub_fqdn>/custom-ee:latest

4.11. 在断开连接的环境中构建执行环境

在构建自定义执行环境时,ansible-builder 工具默认为从互联网下载以下要求:

  • Ansible Galaxy (galaxy.ansible.com) 或 Automation Hub (cloud.redhat.com) 用于添加到 EE 镜像中的任何集合。
  • PyPI (pypi.org),适用于作为集合依赖项所需的任何 python 软件包。
  • UBI 仓库 (cdn.redhat.com),用于更新任何基于 UBI 的 EE 镜像。

    • RHEL 软件仓库可能还需要满足某些集合要求。
  • registry.redhat.io 用于访问 ansible-builder-rhel8 容器镜像。

在断开连接的环境中构建 EE 镜像需要所有这些镜像的子集,或者在断开连接的网络中提供。如需有关 将集合从 Galaxy 或 Automation Hub 导入到私有自动化中心的信息,请参阅将集合导入到 Private Automation Hub 中。

传送到高端网络后镜像 PyPI 内容可以使用 Web 服务器或 Nexus 等工件存储库。

UBI 仓库可以使用如 reposync 的工具在低端镜像,将其导入到断开连接的环境中,并从 Satellite 或一个简单的 Web 服务器提供(因为内容可自由重新分发)。

ansible-builder-rhel8 容器镜像可以按照导入自定义 EE 的方式导入到私有自动化中心。如需了解为 registry.redhat.io/ansible-automation-platform-21/ansible-builder-rhel8 替换 localhost/custom-ee 的详情,请参阅 传输自定义 EE 镜像。这将使 ansible-builder-rhel8 镜像在私有自动化中心 registry 以及默认的 EE 镜像中可用。

在高端网络上提供了所有先决条件后,可以使用 ansible-builder 和 Podman 来创建自定义执行环境镜像。

4.12. 安装 ansible-builder RPM

流程

  1. 在 RHEL 系统上,安装 ansible-builder RPM。这可以通过以下方法之一完成:

    1. 将 RHEL 框订阅到断开连接的网络上的 Satellite。
    2. 附加 Ansible Automation Platform 订阅并启用 Ansible Automation Platform 存储库。
    3. 安装 ansible-builder RPM。

      注意

      如果存在 Satellite,则首选,因为如果底层构建主机已注册了底层构建主机,则执行环境镜像可以使用 Satellite 中的 RHEL 内容。

  2. 解压缩 Ansible Automation Platform 安装捆绑包。
  3. 从包含的内容安装 ansible-builder RPM 及其依赖项:

    $ tar -xzvf ansible-automation-platform-setup-bundle-2.3-1.2.tar.gz
    $ cd ansible-automation-platform-setup-bundle-2.3-1.2/bundle/el8/repos/
    $ sudo yum install ansible-builder-1.2.0-1.el9ap.noarch.rpm
    python38-requirements-parser-0.2.0-4.el9ap.noarch.rpm
  4. 为您的自定义 EE 构建工件创建一个目录。

    $ mkdir custom-ee
    $ cd custom-ee/
  5. 按照 https://ansible-builder.readthedocs.io/en/stable/definition/ 的文档创建 execution-environment.yml 文件,该文件定义了自定义 EE 的要求。覆盖 EE_BASE_IMAGEEE_BUILDER_IMAGE 变量,以指向私有自动化中心中提供的 EE。

    $ cat execution-environment.yml
    ---
    version: 1
    build_arg_defaults:
      EE_BASE_IMAGE: '<hub_fqdn>/ee-supported-rhel8:latest'
      EE_BUILDER_IMAGE: '<hub_fqdn>/ansible-builder-rhel8:latest'
    
    dependencies:
      python: requirements.txt
      galaxy: requirements.yml
  6. 创建一个 ansible.cfg 文件,指向您的私有自动化中心,其中包含允许上传的凭证,如 admin 用户令牌。

    $ cat ansible.cfg
    [galaxy]
    server_list = private_hub
    
    [galaxy_server.private_hub]
    url=https://<hub_fqdn>/api/galaxy/
    token=<admin_token>
  7. 创建一个指向断开连接的 UBI 存储库镜像的 ubi.repo 文件(如果托管 UBI 内容,这可能是您的 Satellite)。

    这是一个示例输出,其中 reposync 用于镜像 UBI 仓库。

    $ cat ubi.repo
    [ubi-8-baseos]
    name = Red Hat Universal Base Image 8 (RPMs) - BaseOS
    baseurl = http://<ubi_mirror_fqdn>/repos/ubi-8-baseos
    enabled = 1
    gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
    gpgcheck = 1
    
    [ubi-8-appstream]
    name = Red Hat Universal Base Image 8 (RPMs) - AppStream
    baseurl = http://<ubi_mirror_fqdn>/repos/ubi-8-appstream
    enabled = 1
    gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
    gpgcheck = 1
  8. 添加用于为私有自动化中心 web 服务器证书签名的 CA 证书。

    1. 对于自签名证书(安装程序默认),从您的私有自动化中心中生成文件 /etc/pulp/certs/root.crt 并将其命名为 hub-root.crt
    2. 如果使用内部证书颁发机构来请求和签署私有自动化中心 web 服务器证书,请复制该 CA 证书,名为 hub-root.crt
  9. 使用您的自定义 EE 镜像所需的内容创建 python requirements.txt 和 ansible 集合 requirements.yml。请注意,您需要的任何集合都应上传到您的私有自动化中心中。
  10. 使用 ansible-builder 创建用于构建 EE 镜像的上下文目录。

    $ ansible-builder create
    Complete! The build context can be found at: /home/cloud-user/custom-ee/context
    $ ls -1F
    ansible.cfg
    context/
    execution-environment.yml
    hub-root.crt
    pip.conf
    requirements.txt
    requirements.yml
    ubi.repo
  11. 将用于覆盖面向互联网的默认值的文件复制到上下文目录中。

    $ cp ansible.cfg hub-root.crt pip.conf ubi.repo context/
  12. 编辑文件 context/Containerfile 并添加以下修改。

    1. 在第一个 EE_BASE_IMAGE 构建部分中,添加 ansible.cfghub-root.crt 文件,并运行 update-ca-trust 命令。
    2. EE_BUILDER_IMAGE 构建部分中,添加 ubi.repopip.conf 文件。
    3. 在最终的 EE_BASE_IMAGE 构建部分中,添加 ubi.repo 和 pip.conf 文件。

      $ cat context/Containerfile
      ARG EE_BASE_IMAGE=<hub_fqdn>/ee-supported-rhel8:latest
      ARG EE_BUILDER_IMAGE=<hub_fqdn>/ansible-builder-rhel8:latest
      
      FROM $EE_BASE_IMAGE as galaxy
      ARG ANSIBLE_GALAXY_CLI_COLLECTION_OPTS=
      USER root
      
      ADD _build /build
      WORKDIR /build
      
      # this section added
      ADD ansible.cfg /etc/ansible/ansible.cfg
      ADD hub-root.crt /etc/pki/ca-trust/source/anchors/hub-root.crt
      RUN update-ca-trust
      # end additions
      RUN ansible-galaxy role install -r requirements.yml \
          --roles-path /usr/share/ansible/roles
      RUN ansible-galaxy collection install \
          $ANSIBLE_GALAXY_CLI_COLLECTION_OPTS -r requirements.yml \
          --collections-path /usr/share/ansible/collections
      
      FROM $EE_BUILDER_IMAGE as builder
      
      COPY --from=galaxy /usr/share/ansible /usr/share/ansible
      
      ADD _build/requirements.txt requirements.txt
      RUN ansible-builder introspect --sanitize \
          --user-pip=requirements.txt \
          --write-bindep=/tmp/src/bindep.txt \
          --write-pip=/tmp/src/requirements.txt
      # this section added
      ADD ubi.repo /etc/yum.repos.d/ubi.repo
      ADD pip.conf /etc/pip.conf
      # end additions
      RUN assemble
      
      FROM $EE_BASE_IMAGE
      USER root
      
      COPY --from=galaxy /usr/share/ansible /usr/share/ansible
      # this section added
      ADD ubi.repo /etc/yum.repos.d/ubi.repo
      ADD pip.conf /etc/pip.conf
      # end additions
      
      COPY --from=builder /output/ /output/
      RUN /output/install-from-bindep && rm -rf /output/wheels
  13. 使用 podman 命令在本地 podman 缓存中创建 EE 镜像。

    $ podman build -f context/Containerfile \
        -t <hub_fqdn>/custom-ee:latest
  14. 自定义 EE 镜像构建成功后,将其推送到私有自动化中心。

    $ podman push <hub_fqdn>/custom-ee:latest

4.12.1. 在次版本 Ansible Automation Platform 间升级的工作流

要在 Ansible Automation Platform 2 的次发行版本间升级,请使用这个常规工作流。

流程

  1. 下载并解压缩最新的 Ansible Automation Platform 2 安装捆绑包。
  2. 备份现有安装。
  3. 将现有安装清单文件复制到新的安装捆绑包目录中。
  4. 运行 ./setup.sh 以升级安装。

例如,要从 2.2.0-7 升级到 2.3-1.2,请确保两个设置捆绑包都位于安装发生的初始控制器节点上:

    $ ls -1F
ansible-automation-platform-setup-bundle-2.2.0-7/
ansible-automation-platform-setup-bundle-2.2.0-7.tar.gz
ansible-automation-platform-setup-bundle-2.3-1.2/
ansible-automation-platform-setup-bundle-2.3-1.2.tar.gz

备份 2.2.0-7 安装:

$ cd ansible-automation-platform-setup-bundle-2.2.0-7
$ sudo ./setup.sh -b
$ cd ..

将 2.2.0-7 清单文件复制到 2.3-1.2 捆绑包目录中:

$ cd ansible-automation-platform-setup-bundle-2.2.0-7
$ cp inventory ../ansible-automation-platform-setup-bundle-2.3-1.2/
$ cd ..

使用 setup.sh 脚本从 2.2.0-7 升级到 2.3-1.2 :

$ cd ansible-automation-platform-setup-bundle-2.3-1.2
$ sudo ./setup.sh

附录 A. 清单文件变量

下表包含 Ansible 安装清单文件中使用的预定义变量的信息。并非所有这些变量都是必需的。

A.1. 常规变量

变量描述

enable_insights_collection

如果节点使用 Subscription Manager 注册,则默认安装会将节点注册到 Red Hat Ansible Automation Platform Service 中。设置为 False 以禁用。

默认为 true

registry_password

只有在使用非捆绑包安装程序时,才需要 registry_password

用于访问 registry_url 的密码凭证。

用于 [automationcontroller][automationhub] 组。

registry_usernameregistry_password 中输入 Red Hat Registry Service account 凭证以链接到 Red Hat 容器 registry。

registry_urlregistry.redhat.io 时,如果没有使用捆绑安装程序,则需要用户名和密码。

registry_url

用于 [automationcontroller][automationhub] 组。

默认为 registry.redhat.io

registry_username

只有在使用非捆绑包安装程序时,才需要 registry_username

用于访问 registry_url 的用户权限。

用于 [automationcontroller][automationhub] 组,但只有 registry_url 的值为 registry.redhat.io 时才使用。

registry_usernameregistry_password 中输入 Red Hat Registry Service account 凭证以链接到 Red Hat 容器 registry。

routable_hostname

如果运行安装程序的机器只能通过特定 URL 路由到目标主机,例如,如果您的清单中使用短名称,但运行安装程序的节点只能解析使用 FQDN 的主机时,使用 routable hostname

如果没有设置 routable_hostname,它应默认为 ansible_host。然后,如果没有且只没有设置 ansible_host 时,inventory_hostname 才用作最后的手段。

请注意,此变量用作特定主机的主机变量,而不在 [all:vars] 部分下。如需更多信息,请参阅 将变量分配给一个 machine:host 变量

A.2. Ansible Automation hub 变量

变量描述

automationhub_admin_password

必填

automationhub_api_token

如果从 Ansible Automation Platform 2.0 或更早版本升级,您必须:

  • 提供一个现有的 Ansible Automation hub 令牌作为 automationhub_api_token
  • generate_automationhub_token 设置为 true 来生成新令牌

生成新令牌会导致现有令牌无效。

automationhub_authentication_backend

默认不设置此变量。将它设置为 ldap 以使用 LDAP 身份验证。

当它被设置为 ldap 时,还必须设置以下变量:

  • automationhub_ldap_server_uri
  • automationhub_ldap_bind_dn
  • automationhub_ldap_bind_password
  • automationhub_ldap_user_search_base_dn
  • automationhub_ldap_group_search_base_dn

automationhub_auto_sign_collections

如果启用了集合签名服务,则集合默认不会自动签名。

将此参数设置为 true 默认禁用它们。

默认为 false

automationhub_backup_collections

可选

Ansible Automation hub 在 /var/lib/pulp 中提供工件。自动化控制器默认自动备份工件。

您还可以设置 automationhub_backup_collections = false,备份/恢复 进程不会备份或恢复 /var/lib/pulp

默认为 true

automationhub_collection_seed_repository

当捆绑包安装程序运行时,验证的内容将上传到 validated 存储库,认证的内容将上传到 rh-certified 存储库。

默认情况下,经过认证和验证的内容都会被上传。

此变量的可能值为 'certified' 或 'validated'。

如果您不想安装内容,请将 automationhub_seed_collections 设置为 false 来禁用 seeding。

如果您只需要一种类型的内容,请将 automationhub_seed_collections 设置为 true,将 automationhub_collection_seed_repository 设置为您要包含的内容类型。

automationhub_collection_signing_service_key

如果启用了集合签名服务,您必须提供此变量,以确保可以正确签名集合。

/absolute/path/to/key/to/sign

automationhub_collection_signing_service_script

如果启用了集合签名服务,您必须提供此变量,以确保可以正确签名集合。

/absolute/path/to/script/that/signs

automationhub_create_default_collection_signing_service

默认安装不会创建签名服务。如果设置为 true,则创建签名服务。

默认为 false

automationhub_container_signing_service_key

如果启用了容器签名服务,您必须提供此变量,以确保容器可以被正确签名。

/absolute/path/to/key/to/sign

automationhub_container_signing_service_script

如果启用了集合签名服务,您必须提供此变量,以确保容器可以被正确签名。

/absolute/path/to/script/that/signs

automationhub_create_default_contaier_signing_service

默认安装不会创建签名服务。如果设置为 true,则创建签名服务。

默认为 false

automationhub_disable_hsts

默认安装部署一个启用了 TLS 的 Ansible Automation hub。如果 Automation hub 部署了启用了 HTTP Strict Transport Security (HSTS) web-security 策略的自动化中心。除非另有指定,否则启用 HSTS web-security 策略机制。如果需要,此设置允许您禁用此设置。

默认为 false

automationhub_disable_https

可选

如果 Ansible Automation hub 部署启用了 HTTPS。

默认为 false

automationhub_enable_api_access_log

当设置为 true 时,在 /var/log/galaxy_api_access.log 中创建一个日志文件,该文件会记录提供给平台的所有用户操作,包括其用户名和 IP 地址

默认为 false

automationhub_enable_analytics

指明是否为 Ansible Automation Platform 2.3 中自动化中心中使用的 pulpcore 版本启用 Pulp 分析的布尔值。

要启用 pulp 分析,请设置 automationhub_enable_analytics = true

默认为 false

automationhub_enable_unauthenticated_collection_access

启用未授权用户查看集合。

要启用未授权用户查看集合,请设置 automationhub_enable_unauthenticated_collection_access = true

默认为 false

automation_hub_enable_unauthenticated_collection_download

启用未授权用户下载集合。

要启用未授权用户下载集合,请设置 automationhub_enable_unauthenticated_collection_download = true

默认为 false

automationhub_importer_settings

可选

传递给 galaxy-importer 的设置字典。

在导入时,集合可以通过一系列检查。

行为由 galaxy-importer.cfg 配置驱动。

例如 ansible-docansible-lintflake8

这个参数可让您驱动此配置。

automationhub_main_url

客户端连接到的主 {HubNameShort} URL。

例如: https://<load balancer host>。

如果没有指定,则使用 [automationhub] 组中的第一个节点。

如果要在自动化中心环境中实施 Red Hat Single Sign-On,使用 automationhub_main_url 指定客户端连接到的主自动化中心 URL。

automationhub_pg_database

必需

数据库名称。

默认为 automationhub

automationhub_pg_host

如果不使用内部数据库,则需要此项。

automationhub_pg_password

Automation hub PostgreSQL 数据库的密码。

不要对 automationhub_pg_password 使用特殊字符。它们可能会导致密码失败。

automationhub_pg_port

如果不使用内部数据库,则需要此项。

默认 = 5432

automationhub_pg_sslmode

必需。

默认为 prefer

automationhub_pg_username

必填

默认为 automationhub

automationhub_require_content_approval

可选

如果自动化中心在集合可用前强制实施批准机制。

默认情况下,当您将集合上传到自动化中心时,管理员必须批准它,然后供用户使用。

如果要禁用内容批准流,请将变量设置为 false

默认为 true

automationhub_seed_collections

定义是否启用预加载的布尔值。

当捆绑包安装程序运行时,默认情况下,新存储库会在名为 validated' 的私有自动化中心中创建,并更新验证的集合列表。

如果您不想安装内容,请将 automationhub_seed_collections 设置为 false 来禁用 seeding。

如果您只需要一种类型的内容,请将 automationhub_seed_collections 设置为 true,将 automationhub_collection_seed_repository 设置为您要包含的内容类型。

默认为 true

automationhub_ssl_cert

可选

/path/to/automationhub.certweb_server_ssl_cert 相同,但用于自动化中心 UI 和 API

automationhub_ssl_key

可选

/path/to/automationhub.key

web_server_ssl_key 相同,但用于自动化 hub UI 和 API

automationhub_ssl_validate_certs

对于 Red Hat Ansible Automation Platform 2.3 及更新的版本,不再使用这个值。

如果自动化中心因为默认设置,在请求自身时需要验证证书,则 Ansible Automation Platform 会使用自签名证书部署。

默认为 false

automationhub_upgrade

已弃用

对于 Ansible Automation Platform 2.2.1 及更新的版本,它的值已固定为 true。

Automation hub 始终使用最新的软件包进行更新。

generate_automationhub_token

如果从 Red Hat Ansible Automation Platform 2.0 或更早版本进行升级,您必须:

  • 提供一个现有的 Ansible Automation hub 令牌作为 automationhub_api_token
  • generate_automationhub_token 设置为 true 来生成新令牌。生成新令牌会导致现有令牌无效。

nginx_hsts_max_age

此变量指定系统应被视为 HTTP Strict Transport Security (HSTS)主机的时间(以秒为单位)。也就是 HTTPS 专用于通信的时间。

默认为 63072000 秒,或两年。

nginx_tls_protocols

定义 Nginx 中对 ssl_protocols 的支持。

默认为 TLSv1.2

pulp_db_fields_key

您要导入的 Fernet 对加密密钥的相对或绝对路径。该路径位于 Ansible 管理节点上。它用于加密数据库中的某些字段(如凭证)。如果未指定,将生成一个新密钥。

要使 Ansible Automation hub 直接连接到 LDAP,必须配置以下变量。可以使用 ldap_extra_settings 变量传递的其他 LDAP 相关变量(未由以下 automationhub_ldap_xxx 变量涵盖)的列表,可在此处找到: https://django-auth-ldap.readthedocs.io/en/latest/reference.html#settings

变量描述

automationhub_ldap_bind_dn

使用 automationhub_ldap_bind_password 绑定到 LDAP 服务器时使用的名称。

automationhub_ldap_bind_password

必需

automationhub_ldap_bind_dn 搭配使用的密码。

automationhub_ldap_group_search_base_dn

一个 LDAPSearch 对象,用于查找用户可能属于的所有 LDAP 组。如果您的配置对 LDAP 组有任何引用,则必须设置此 和 automationhub_ldap_group_type

默认为 None

automatiohub_ldap_group_search_filter

可选

用于查找组成员资格的搜索过滤器。

变量标识了使用自动化中心和 LDAP 映射组要使用哪个 flavor 类型。用于通过 LDAP 安装自动化中心。

默认为 (objectClass=Group)

automationhub_ldap_group_search_scope

可选

范围使用 django 框架用于 LDAP 身份验证在 LDAP 树中搜索组。用于通过 LDAP 安装自动化中心。

默认为 SUBTREE

automationhub_ldap_group_type_class

可选

变量标识在 django 框架内用于 LDAP 身份验证的组类型。用于通过 LDAP 安装自动化中心。

Default =django_auth_ldap.config:GroupOfNamesType

automationhub_ldap_server_uri

LDAP 服务器的 URI。这可以是底层 LDAP 库支持的任何 URI。

automationhub_ldap_user_search_base_dn

在目录中查找用户的 LDAPSearch 对象。filter 参数应包含用户名的占位符 %(user)。它必须完全返回一个结果才能成功进行身份验证。

automationhub_ldap_user-search_scope

可选

范围使用 django 框架用于 LDAP 身份验证在 LDAP 树中搜索用户。用于通过 LDAP 安装自动化中心。

默认为 'SUBTREE

A.3. Red Hat Single Sign-On 变量

* 将这些变量用于 automationhubAutomationcatalog

变量描述

sso_automation_platform_login_theme

可选

用于 Ansible Automation Platform 管理的和外部管理的 Red Hat Single Sign-On。

主题文件所在的目录的路径。如果更改此变量,您必须提供自己的主题文件。

默认 = ansible-automation-platform

sso_automation_platform_realm

可选

用于 Ansible Automation Platform 管理的和外部管理的 Red Hat Single Sign-On。

SSO 中域的名称。

默认 = ansible-automation-platform

sso_automation_platform_realm_displayname

可选

用于 Ansible Automation Platform 管理的和外部管理的 Red Hat Single Sign-On。

显示域的名称。

默认 = Ansible Automation Platform

sso_console_admin_username

可选

用于 Ansible Automation Platform 管理的和外部管理的 Red Hat Single Sign-On。

SSO 管理用户名。

默认 = admin

sso_console_admin_password

必需

用于 Ansible Automation Platform 管理的和外部管理的 Red Hat Single Sign-On。

SSO 管理密码。

sso_custom_keystore_file

可选

仅用于 Ansible Automation Platform 管理的 Red Hat Single Sign-On。

为 SSO 提供客户提供的密钥存储。

sso_host

必需

仅用于外部管理的 Red Hat Single Sign-On。

自动化中心和 Automation 服务目录需要 SSO 和 SSO 管理凭证进行身份验证。

还需要 SSO 管理凭据,以设置应用所需的自动化服务目录特定角色。

如果清单中未提供用于配置的 SSO,则必须使用此变量来定义 SSO 主机。

sso_keystore_file_remote

可选

仅用于 Ansible Automation Platform 管理的 Red Hat Single Sign-On。

如果客户提供的密钥存储位于远程节点上,则设置为 true

默认为 false

sso_keystore_name

可选

仅用于 Ansible Automation Platform 管理的 Red Hat Single Sign-On。

SSO 的密钥存储名称。

默认 = ansible-automation-platform

sso_keystore_password

启用 HTTPS 的 SSO 的密钥存储密码。

在使用 Ansible Automation Platform 管理的 SSO 以及启用 HTTPS 时,需要此项。默认安装使用 sso_use_https=true 部署 SSO。

sso_redirect_host

可选

用于 Ansible Automation Platform 管理的和外部管理的 Red Hat Single Sign-On。

如果设置了 sso_redirect_host,应用程序会使用它来连接到 SSO 以进行身份验证。

这必须可从客户端机器访问。

sso_ssl_validate_certs

可选

用于 Ansible Automation Platform 管理的和外部管理的 Red Hat Single Sign-On。

如果要在连接过程中验证证书,设置为 true

默认为 true

sso_use_https

可选

用于 Ansible Automation Platform 管理的和外部管理的 Red Hat Single Sign-On。

如果单点登录使用 https。

默认为 true

A.4. 自动化服务目录变量

变量描述

automationcatalog_controller_password

用于从控制器主机生成令牌。

还需要定义 automation_controller_main_url

automationcatalog_controller_token

用于为自动化控制器创建预创建的 OAuth 令牌。此令牌将被使用,而不是生成令牌。

automationcatalog_controller_username

用于从控制器主机生成令牌。还需要定义 automation_controller_main_url

automationcatalog_controller_verify_ssl

用于启用或禁用自动化服务目录到自动化控制器的 SSL 验证。

默认为 true

automationcatalog_disable_hsts

用于启用或禁用自动服务目录的 HSTS web-security 策略。

默认 = 'false.

automationcatalog_disable_https

用于启用或禁用 Services Catalog 的 HSTS web-security 策略。

默认为 false

automationcatalog_enable_analytics_collection

用于控制自动服务目录的分析集合激活

automationcatalog_main_url

如果需要在 SSO 和自动服务目录主机之间进行使用的替代主机名,则由红帽单点登录主机配置使用。

automationcatalog_pg_database

自动服务目录的 postgres 数据库 URL。

automationcatalog_pg_host

用于自动化服务目录的 PostgreSQL 主机(数据库节点)

automationcatalog_pg_password

自动服务目录的 PostgreSQL 数据库的密码。

对于 automationcatalog_pg_password,不要使用特殊字符。它们可能会导致密码失败。

automationcatalog_pg_port

用于自动化服务目录的 PostgreSQL 端口。

默认 = 5432

automationcatalog_pg_username

自动服务目录的 postgres ID。

automationcatalog_ssl_cert

自定义提供的 SSL 证书文件的路径。需要 Automationcatalog_ssl_key。使用内部管理的 CA 进行签名,如果未提供证书并且启用了 https,则创建证书。

automationcatalog_ssl_key

自定义提供的 SSL 证书密钥文件的路径。

需要 automationcatalog_ssl_cert

内部管理的 CA 签署,并在为提供且启用了 https 的情况下创建证书。

A.5. 自动化控制器变量

变量描述

admin_password

安装完成时访问 UI 的管理用户的密码。

automation_controller_main_url

对于 SSO 配置自动化服务目录所需的替代前端 URL,请提供 URL。

自动化服务目录需要控制器安装,或者一个指向活跃和可路由的 Controller 服务器的 URL 则必须提供此变量

automationcontroller_password

自动化控制器实例的密码。

automationcontroller_username

自动化控制器实例的用户名。

nginx_http_port

nginx HTTP 服务器侦听入站连接。

默认为 80

nginx_https_port

nginx HTTPS 服务器侦听安全连接。

默认为 443

nginx_hsts_max_age

此变量指定系统应被视为 HTTP Strict Transport Security (HSTS)主机的时间(以秒为单位)。也就是 HTTPS 专用于通信的时间。

默认为 63072000 秒,或两年。

nginx_tls_protocols

定义 Nginx 中对 ssl_protocols 的支持。

默认为 TLSv1.2

node_state

可选

节点或一组节点的状态。有效选项为 active, deprovision 从集群中删除节点,或 iso_migrate 将旧的隔离节点迁移到执行节点。

默认为 active

node_type

对于 [automationcontroller] 组。

可以为这个组分配两个有效的 node_types

node_type=control 意味着节点只运行项目和清单更新,但不运行常规作业。

node_type=hybrid 能够运行所有内容。

这个组的默认为 hybrid

对于 [execution_nodes]

可以为这个组分配两个有效的 node_types。

node_type=hop 表示节点将作业转发到执行节点。

node_type=execution 表示节点可以运行作业。

此组的默认值为 execution

peers

可选

peers 变量用于指示特定主机或组连接到哪些节点。一旦定义了 peers 变量,则将建立出站连接到特定主机或组。

此变量用于在 receptor.conf 文件中添加用于与其他节点建立网络连接的 tcp-peer 条目。请参阅 Peering

peers 变量可以是清单中以逗号分隔的主机和/或组的列表。这被解析为用来构造 receptor.conf 文件的一组主机。

pg_database

postgres 数据库的名称。

默认为 awx

pg_host

postgreSQL 主机,可以是外部管理的数据库。

pg_password

postgreSQL 数据库的密码。

对于 forpg_password,不要使用特殊字符。它们可能会导致密码失败。

注意

安装时,您将不再需要在清单文件中提供 apg_hashed_password,因为 PostgreSQL 13 现在可以更加安全地存储用户的密码。

当您在清单文件中为安装程序提供 pg_password 时,PostgreSQL 使用 SCRAM-SHA-256 哈希在安装过程中保护该密码。

pg_port

要使用的 postgreSQL 端口。

默认 = 5432

pg_ssl_mode

preferverify-full 之一。

设置为 verify-full,用于客户端强制执行 SSL。

默认为 prefer

pg_username

您的 postgres 数据库用户名。

默认为 awx

postgres_ssl_cert

postgres ssl 证书的位置。

/path/to/pgsql_ssl.cert

postgres_ssl_key

postgres ssl 键的位置。

/path/to/pgsql_ssl.key

postgres_use_cert

postgres 用户证书的位置。

/path/to/pgsql.crt

postgres_use_key

postgres 用户密钥的位置。

/path/to/pgsql.key

postgres_use_ssl

postgres 是否使用 SSL。

receptor_listener_port

用于 recptor 连接的端口。

默认 = 27199。

supervisor_start_retry_count

当指定时(不存在默认值),将 startretries = <value specified> 添加到 supervisor 配置文件 (/etc/supervisord.d/tower.ini) 中。

有关 startretries 的进一步说明,请参阅 program:x section 值

web_server_ssl_cert

可选

/path/to/webserver.cert

automationhub_ssl_cert 相同,但用于 Web 服务器 UI 和 API。

web_server_ssl_key

可选

/path/to/webserver.key

automationhub_server_ssl_key 相同,但用于 Web 服务器 UI 和 API。

A.6. Ansible 变量

以下变量控制 Ansible Automation Platform 与远程主机交互的方式。

有关特定于特定插件的变量的附加信息,请参考 https://docs.ansible.com/ansible-core/devel/collections/ansible/builtin/index.html

全局配置选项列表请参考 https://docs.ansible.com/ansible-core/devel/reference_appendices/config.html

变量描述

ansible_connection

用于目标主机上任务的连接插件。

这可以是任何 ansible 连接插件的名称。SSH 协议类型是 smartsshparamiko

默认为 smart

ansible_host

要使用的目标主机的 ip 或名称,而不是 inventory_hostname

ansible_port

连接端口号(如果没有提供,默认为 22 用于 ssh)。

ansible_user

连接到主机时使用的用户名。

ansible_password

用于向主机进行身份验证的密码。

从不以纯文本形式存储此变量。

始终使用密码库。

ansible_ssh_private_key_file

ssh 使用的私钥文件。在使用多个密钥且您不想使用 SSH 代理时很有用。

ansible_ssh_common_args

此设置始终附加到 sftpscpssh 的默认命令行中。对于为特定主机(或组)配置 ProxyCommand 很有用。

ansible_sftp_extra_args

此设置始终附加到默认的 sftp 命令行。

ansible_scp_extra_args

此设置始终附加到默认的 scp 命令行。

ansible_ssh_extra_args

此设置始终附加到默认的 ssh 命令行。

ansible_ssh_pipelining

确定是否使用 SSH pipelining。这可以覆盖 ansible.cfg 中的 pipelining 设置。如果使用基于 SSH 密钥的身份验证,则密钥必须由 SSH 代理管理。

ansible_ssh_executable

(在 2.2 版中添加)

此设置覆盖使用系统 ssh 的默认行为。这可以覆盖 ansible.cfg 中的 ssh_executable 设置。

ansible_shell_type

目标系统的 shell 类型。除非将 ansible_shell_executable 设置为一个非兼容 shell,否则不应使用此设置。默认情况下,使用 sh 样式的语法对命令进行了格式化。把它设置为 cshfish 会导致在目标系统上执行命令来遵循这些 shell 的语法。

ansible_shell_executable

这会设置 ansible 控制器在目标机器上使用的 shell,并覆盖 ansible.cfg 中的可执行文件,默认为 /bin/sh

只有在无法使用 /bin/sh 时(也就是说,如果目标机器上没有安装 /bin/sh )或者无法从 sudo 运行,才应更改。

inventory_hostname

此变量从清单脚本或 ansible 配置文件获取机器的主机名。

您不能设置此变量的值。

由于从配置文件中获取了该值,实际运行时主机名值可能与此变量返回的不同。

法律通告

Copyright © 2024 Red Hat, Inc.
The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, the Red Hat logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.