第 8 章 安装私有 Automation Hub

设置好所有先决条件后,最后一步是修改集群的自动化中心安装并运行 setup.sh 的清单文件

在这个引用环境中,controlplane-1.site1.example.com 系统用于运行集群的自动化中心环境的 setup.sh,因为它可以访问所有节点。

注意

以下安装是在此参考环境 Ansible Automation Platform 集群的站点 Ansible Site 1 中完成的。完成后,确保遵循 Ansible Site 2 的同一步骤。

controlplane-1.site1.example.com 上,以 ansible 用户身份执行以下操作:

  1. 将目录更改为 ansible-automation-platform-setup-2.1.0-1.tar.gz

    cd ansible-automation-platform-setup-2.1.0-1/
  2. 备份现有 清单文件

    $ cp inventory inventory-controller.bkup
  3. 修改 清单文件,使其包含与您环境相关的信息。以下是此参考环境的示例。

    [automationcontroller]
    
    [automationcontroller:vars]
    
    [execution_nodes]
    
    [automationhub]
    ahub-1.site1.example.com 1
    ahub-2.site1.example.com
    ahub-3.site1.example.com
    
    
    [database]
    ahub-db.site1.example.com 2
    
    [servicescatalog_workers]
    
    [sso]
    
    [all:vars]
    admin_password=''
    
    pg_host=''
    pg_port=''
    
    pg_database=''
    pg_username=''
    pg_password=''
    pg_sslmode=''  # set to 'verify-full' for client-side enforced SSL
    
    registry_url= 'registry.redhat.io' 3
    registry_username='myusername' 4
    
    
    #Handled by Ansible vault
    registry_password='' 5
    
    receptor_listener_port=27199
    
    #Handled by Ansible vault
    automationhub_admin_password='' 6
    
    automationhub_pg_host='ahub-db.site1.example.com' 7
    automationhub_pg_port='5432' 8
    
    automationhub_pg_database='automationhub'
    automationhub_pg_username='automationhub'
    
    #Handled by Ansible vault
    automationhub_pg_password='' 9
    
    automationhub_pg_sslmode='prefer'
    
    sso_console_admin_password=''
    1
    自动化中心节点。
    2
    设置将为自动化中心安装安装 PostgreSQL 数据库的节点。
    3
    执行环境镜像已下载并包含在您的安装中。下载镜像所需的正确凭证。
    4
    用于访问 registry_url 的用户凭据。
    5
    用于访问 registry_url 的密码凭证。
    6
    设置 admin 用户的密码,在安装完成时访问 UI。
    7
    设置 PostgreSQL 主机(数据库节点)。
    8
    设置用于自动化中心数据库节点的 PostgreSQL 端口。
    9
    设置 PostgreSQL 数据库的密码。
    注意

    有关 Ansible Automation Platform 控制器安装的所有信息已被删除。

  4. 创建一个标记为 credentials_ah.yml 的文件,它将存储加密凭据。

    $ cat credentials_ah.yml
    automationhub_admin_password: my_long_ahub_pw
    automationhub_pg_password: my_long_ahub_pw
    registry_password: my_long_registry_pw
  5. 使用 ansible-vault 加密 credentials_ah.yml 文件。

    $ ansible-vault encrypt credentials_ah.yml
    New Vault password:
    Confirm New Vault password:
    Encryption successful
    警告

    将加密的 vault 密码存储在安全的地方。

  6. 验证 credentials_ah.yml 文件是否已加密

    $ cat credentials_ah.yml
    $ANSIBLE_VAULT;1.1;AES256
    36383639653562386534316333333961383336306465336465613831353435313530376464616539
    3765393063303065323466663330646232363065316666310a373062303133376339633831303033
    34313534383962613632303761636632623932653062343839613639653635643365616233313365
    3636616639313864300a353239373433313339613465326339313035633565353464356538653631
    63346434383534643237663862353361366632613634333231316334363939396461326561643336
    3430633534303935646264633034383966336232303365383763
  7. 运行 setup.sh 用于安装 Ansible Automation Platform 2.1,并传递 credentials_ah.yml,以及 --ask-vault-pass 选项

    $ ANSIBLE_BECOME_METHOD='sudo' ANSIBLE_BECOME=True ANSIBLE_HOST_KEY_CHECKING=False ./setup.sh -e @credentials_ah.yml -- --ask-vault-pass
    注意

    设置了以下 ANSIBLE*_ 变量,以确保安装成功。

    注意

    有关清单文件中可设置的不同值的更多信息,请访问: 设置清单文件

  8. 登录到私有自动化中心仪表板,如 automationhub-cluster.site1.example.com