11.16. Red Hat Enterprise Linux システムロール
Ansible 2.9 で RHEL システムロールを使用すると、command
モジュールで dnf
を使用することに関する警告が表示されることがあります。
RHEL 8.8 以降、RHEL システムロールは dnf
モジュールで warn
パラメーターを使用しなくなりました。これは、このパラメーターが Ansible Core 2.14 で削除されたためです。ただし、Ansible 2.9 で最新の rhel-system-roles
パッケージを使用し、ロールがパッケージをインストールすると、次のいずれかの警告が表示される場合があります。
[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 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.
[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.
これらの警告を非表示にする場合は、ansible.cfg
ファイルの [Defaults]
セクションに command_warnings = False
設定を追加します。ただし、この設定により Ansible のすべての警告が無効になることに注意してください。
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
上のリソースを管理できます。詳細は、記事 RHEL system roles playbooks fail when run on localhost を参照してください。
firewalld.service
がマスクされている場合、firewall
RHEL システムロールの使用が失敗する
RHEL システム上で firewalld.service
がマスクされている場合、firewall
RHEL システムロールは失敗します。この問題を回避するには、firewalld.service
のマスクを解除します。
systemctl unmask firewalld.service
systemctl unmask firewalld.service
rhc_auth
にアクティベーションキーが含まれている場合、rhc
システムロールはすでに登録されているシステムで失敗します。
rhc_auth
パラメーターにアクティベーションキーが指定されている場合、すでに登録されているシステムで Playbook ファイルを実行すると失敗します。この問題を回避するには、登録済みのシステムで Playbook ファイルを実行するときにアクティベーションキーを指定しないでください。