第 2 章 安装 JBoss Web 服务器集合
作为使用 Ansible 自动部署 Red Hat JBoss Web Server 的第一步,您必须从 Ansible Automation Hub 下载并安装 JBoss Web Server 集合。JBoss Web Server 集合在 Ansible Automation Hub 中命名为 redhat.jws。在安装 JBoss Web 服务器集合前,您必须确保您的系统满足特定的先决条件。
前提条件
您可以通过安装 Red Hat Ansible Automation Platform 2.x,在系统上的控制节点上安装了
ansible-core软件包版本 2.16 或更高版本。有关安装 Red Hat Ansible Automation Platform 的更多信息,请参阅 Red Hat Ansible Automation Platform 安装指南。
-
您已更新了
ansible.cfg文件,以使用 Ansible Automation Hub 作为 Ansible 集合 的主要来源。有关更新ansible.cfg文件的更多信息,请参阅开始使用自动化中心。
流程
在 Ansible 控制节点上输入以下命令:
ansible-galaxy collection install redhat.jws
$ ansible-galaxy collection install redhat.jwsCopy to Clipboard Copied! Toggle word wrap Toggle overflow 注意如果前面的命令生成
Failed to find collection redhat.jws:*错误消息,请确定您正确更新了ansible.cfg文件以使用 Ansible Automation hub,如 Getting started with Automation hub 所述。前面的命令会产生以下输出:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 对于 brevity,前面的示例使用 ellipses 来表示忽略的文本。在前面的输出中,<
;version> 代表安装的redhat.jws、redhat.runtimes_common、ansible.posix集合的最新可用版本。
验证
在 Ansible 控制节点上输入以下命令:
ansible-galaxy collection list
$ ansible-galaxy collection listCopy to Clipboard Copied! Toggle word wrap Toggle overflow 上述命令显示安装的集合列表。例如:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
如上例所示,当您安装 redhat.jws 集合时,ansible.posix 和 redhat.runtimes_common 集合的最新版本也会在 Ansible 控制节点上自动下载并安装。redhat.runtimes_common 集合提供了一组标准实用程序,以支持各种 Red Hat Runtimes 产品(如 JBoss Web Server)的自动化部署。
如果您的 Ansible 控制节点上已存在最新版本的 ansible.posix 和 redhat.runtimes_common 集合,则这些集合不会再次自动安装。