第 2 章 为 SAP 安装 Ansible Engine 和 RHEL 系统角色
使用以下步骤为 SAP 软件包或集合安装 Ansible Core 和 RHEL 系统角色。
要在 Red Hat Satellite 系统上安装软件包,请不要使用 plain dnf 命令,而是按照 如何在 Red Hat Satellite 6 中安装和更新软件包 的步骤进行操作?
流程
安装 Ansible Core:
dnf install ansible-core
# dnf install ansible-coreCopy to Clipboard Copied! Toggle word wrap Toggle overflow 继续第 2 步来安装 RHEL 软件包
rhel-system-roles-sap或第 3 步用于安装 Automation Hub 集合redhat.sap_install。要安装 RHEL 软件包
rhel-system-roles-sap:使用 Red Hat Subscription Manager 启用 RHEL for SAP Solutions 存储库:
subscription-manager repos
# subscription-manager repos --enable=rhel-$(rpm -E %rhel)-for-$(uname -m)-sap-solutions-rpmsCopy to Clipboard Copied! Toggle word wrap Toggle overflow 为 SAP 安装 RHEL 系统角色:
dnf install rhel-system-roles-sap
# dnf install rhel-system-roles-sapCopy to Clipboard Copied! Toggle word wrap Toggle overflow rhel-system-roles-sap软件包被安装到/usr/share/ansible/roles/<role>中,其中 <role> 是单个角色的名称,例如sap_hana_preconfigure。每个角色都包括一个README.md文件,它解释了所有变量以及如何使用角色。
要安装 Automation Hub 集合
redhat.sap_install,您可以直接从 Automation Hub 安装集合,或者首先下载它,然后从下载的文件安装它。要直接从 Automation Hub 安装集合,请按照 本页 中的说明操作。基本步骤为:
- 从 此页面 复制您的离线令牌、服务器 URL 和 SSO URL,并记下同一页面上的服务器 URL 和 SSO URL。如果需要(例如因为过期),重新创建令牌。
根据 本章中 的说明,使用这些值配置文件
/etc/ansible/ansible.cfg。使用 Server URL for 变量url、变量auth_url的 SSO URL 和变量 离线令牌,如下例所示(将虚拟令牌替换为实际令牌):Copy to Clipboard Copied! Toggle word wrap Toggle overflow 作为将使用集合的用户的身份安装集合(将运行 playbook 以在受管节点上安装软件或配置设置):
ansible-galaxy collection install redhat.sap_install
# ansible-galaxy collection install redhat.sap_installCopy to Clipboard Copied! Toggle word wrap Toggle overflow 这会将集合安装到用户的默认位置(将递归创建必要目录),即:
~/.ansible/collections/ansible_collections/redhat/sap_install。
要从 Automation Hub 下载集合,然后安装它,请执行以下步骤:
从 此页面 下载集合 tar 文件(使用
Download tarball链接),然后以用户身份运行以下命令,以使用集合:ansible-galaxy collection install
# ansible-galaxy collection install ./redhat-sap_install-1.2.1.tar.gzCopy to Clipboard Copied! Toggle word wrap Toggle overflow 这也会将集合安装到用户的默认位置,如前面所述。
sap_install下的每个角色子目录中的文件README.md文件,例如roles/sap_general_preconfigure,其中包含每个角色的文档。