第 2 章 安装 JBoss Web 服务器集合
作为使用 Ansible 自动部署 Red Hat JBoss Web Server 的第一步,您必须从 Ansible 自动化 hub 下载并安装 JBoss Web Server 集合。JBoss Web 服务器集合在 Ansible 自动化中心 中命名为 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注意如果前面的命令生成
Failed to find collection redhat.jws:*错误消息,请确保正确更新了ansible.cfg文件以使用 Ansible Automation hub,如 开始使用自动化中心 所述。前面的命令会产生以下输出:
Starting galaxy collection install process Process install dependency map Starting collection install process ... redhat.jws:<version> was installed successfully ... redhat.runtimes_common:<version> was installed successfully ... ansible.posix:<version> was installed successfully对于 brevity,前面的示例使用 ellipses 来表示忽略的文本。在前面的输出中,<
;version> 代表安装的redhat.jws、redhat.runtimes_common、ansible.posix集合的最新可用版本。
验证
在 Ansible 控制节点上输入以下命令:
$ ansible-galaxy collection list前面的命令显示安装的集合列表。例如:
Collection Version -------------------------- ------- ansible.posix <version> redhat.jws <version> redhat.runtimes_common <version> ...
如上例所示,当安装 redhat.jws 集合时,ansible.posix 和 redhat.runtimes_common 集合的最新版本也会自动下载并安装到 Ansible 控制节点上。redhat.runtimes_common 集合提供了一组标准实用程序,以支持各种红帽运行时产品的自动部署,如 JBoss Web 服务器。
如果 Ansible 控制节点上已存在最新版本的 ansible.posix 和 redhat.runtimes_common 集合,则这些集合不会被再次自动安装。