Uploaded image for project: 'RHEL Documentation'
  1. RHEL Documentation
  2. RHELDOCS-17954

docs - Ansible 2.9 will give [WARNING]: Consider using the dnf module rather than running 'dnf'

XMLWordPrintable

    • sst_system_roles
    • 1
    • False
    • Hide

      None

      Show
      None
    • CCS 2024-8, CCS 2024-9
    • Known Issue
    • Hide
      .Using the RHEL system role with Ansible 2.9 can display a warning about using `dnf` with the `command` module

      Since RHEL 8.8, the RHEL system roles no longer use the `warn` parameter in with the `dnf` module because this parameter was removed in Ansible Core 2.14. However, if you use the latest `rhel-system-roles` package still with Ansible 2.9 and a role installs a package, one of the following warnings can be displayed:

      ----
      [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.
      ----

      If you want to hide these warnings, add the `command_warnings = False` setting to the `[Defaults]` section of the `ansible.cfg` file. However, note that this setting disables all warnings in Ansible.
      Show
      .Using the RHEL system role with Ansible 2.9 can display a warning about using `dnf` with the `command` module Since RHEL 8.8, the RHEL system roles no longer use the `warn` parameter in with the `dnf` module because this parameter was removed in Ansible Core 2.14. However, if you use the latest `rhel-system-roles` package still with Ansible 2.9 and a role installs a package, one of the following warnings can be displayed: ---- [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. ---- If you want to hide these warnings, add the `command_warnings = False` setting to the `[Defaults]` section of the `ansible.cfg` file. However, note that this setting disables all warnings in Ansible.
    • Done
    • Done
    • Done
    • Not Required

      Description of problem:
      In ansible-core 2.14 the `warn:` parameter of `command` was removed. The system roles also removed the use of this parameter. This means on older versions of Ansible such as 2.9, these tasks will issue a warning like this:

      [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.

      or

      [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.

      See https://docs.ansible.com/ansible/latest/collections/ansible/builtin/command_module.html#parameter-warn

      If you must use Ansible 2.9, and you want to avoid these warnings, use the command_warnings configuration setting. See https://docs.ansible.com/ansible/latest/reference_appendices/config.html#command-warnings for more information.

      Version-Release number of selected component (if applicable):

      How reproducible:

      Steps to Reproduce:
      1.
      2.
      3.

      Actual results:

      Expected results:

      Additional info:

            rhn-support-gfialova Gabriela Fialova
            rmeggins@redhat.com Richard Megginson
            Marc Muehlfeld
            Marc Muehlfeld Marc Muehlfeld
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: