搜索

11.16. Red Hat Enterprise Linux 系统角色

download PDF

将 RHEL 系统角色与 Ansible 2.9 搭配使用可能会显示有关使用 dnfcommand 模块的警告

从 RHEL 8.8 开始,RHEL 系统角色不再使用 dnf 模块的 warn 参数,因为此参数已在 Ansible Core 2.14 中删除。但是,如果您使用最新的 rhel-system-roles 软件包仍然与 Ansible 2.9 一起使用,且角色会安装软件包,则可以显示以下警告之一:

[WARNING]: Consider using the dnf module rather than running 'dnf'. If you need to use command because dnf is insufficient you can add 'warn: false' to
this command task or set 'command_warnings=False' in ansible.cfg to get rid of this message.
[WARNING]: Consider using the yum, dnf or zypper module rather than running 'rpm'. If you need to use command because yum, dnf or zypper is insufficient
you can add 'warn: false' to this command task or set 'command_warnings=False' in ansible.cfg to get rid of this message.

如果要隐藏这些警告,请将 command_warnings = False 设置添加到 ansible.cfg 文件的 [Defaults] 部分。但请注意,此设置禁用 Ansible 中的所有警告。

Jira:RHELDOCS-17954

使用 playbook 或清单中的 localhost 主机名无法管理 localhost

RHEL 中包含了 ansible-core 2.13 软件包,如果您在您管理节点的同一台主机上运行 Ansible,则无法通过在 playbook 或清单中使用 localhost 主机名来实现它。这是因为 ansible-core 2.13 使用 python38 模块,并且缺少许多库,例如,用于 storage 角色的 blivet,用于 network 角色的 gobject。要临时解决这个问题,如果您已在 playbook 或清单中使用了 localhost 主机名,您可以使用 ansible_connection=local 来添加一个连接,或者使用 ansible_connection=local 选项创建一个列出 localhost 的清单文件。使用这种方式,您可以管理 localhost 上的资源。如需了解更多详细信息,请参阅文章 在 localhost 上运行时,RHEL 系统角色 playbook 会失败

Bugzilla:2041997

如果 firewalld.service 被屏蔽了,使用 firewall RHEL 系统角色失败

如果在 RHEL 系统上 firewalld.service 被屏蔽了,则 firewall RHEL 系统角色失败。要临时解决这个问题,请对 firewalld.service 取消屏蔽:

systemctl unmask firewalld.service

Bugzilla:2123859

rhc_auth 包含激活密钥时,rhc 系统角色在已注册的系统上会失败

如果为 rhc_auth 参数指定了激活密钥,在在已经注册的系统上执行 playbook 文件会失败。要临时解决这个问题,在已经注册的系统上执行 playbook 文件时不要指定激活密钥。

Bugzilla:2186908

Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

© 2024 Red Hat, Inc.