Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-94046

ansible-core and rhel-system-roles incompatible

Linking RHIVOS CVEs to...Migration: Automation ...SWIFT: POC ConversionSync from "Extern...XMLWordPrintable

    • rhel-system-roles-1.100.1-1.1.el10
    • Yes
    • Low
    • TestCaseProvided
    • rhel-system-roles
    • 0
    • Dev ack
    • False
    • False
    • Hide

      None

      Show
      None
    • No
    • Red Hat Enterprise Linux
    • None
    • Release Note Not Required
    • Hide
      Cause: The system roles collection had {{requires_ansible: ">=2.15.0"}} in the meta/runtime.yml file, which is required for Automation Hub gating.
      Consequence: Using the collection on RHEL 9 gives the error "Collection does not support version 2.14.X" which is the version shipped with RHEL 9. This error message is confusing and distressing to customers.
      Fix: Change the meta/runtime.yml on RHEL 9 to use {{requires_ansible: ">=2.14.0"}}.
      Result: Using the collection on RHEL 9 does not give the error message. We will use the collection built on RHEL 10 for automation hub.
      Show
      Cause: The system roles collection had {{requires_ansible: ">=2.15.0"}} in the meta/runtime.yml file, which is required for Automation Hub gating. Consequence: Using the collection on RHEL 9 gives the error "Collection does not support version 2.14.X" which is the version shipped with RHEL 9. This error message is confusing and distressing to customers. Fix: Change the meta/runtime.yml on RHEL 9 to use {{requires_ansible: ">=2.14.0"}}. Result: Using the collection on RHEL 9 does not give the error message. We will use the collection built on RHEL 10 for automation hub.
    • Unspecified
    • Unspecified
    • Unspecified
    • All
    • None

      The current version of rhel-system-roles as published in the appstream repository (1.95.7-0.1.el9_6) contains ansible collections that require ansible-core version 2.15 or higher, but the highest version of ansible-core published in the same appstream repo is 2.14.18-1.el9

      This is in contradiction to the published articles detailing the scope of support for the ansible-core package from appstream on Enterprise Linux 9:

       

      This results in ansible plays that include any of the roles from the rhel-system-roles package to emit an error like:

      Collection redhat.rhel_system_roles does not support Ansible version 2.14.18

       
      This issue can be easily reproduced by installing a minimal RHEL 9.6 server with the appstream repo enabled and installing the the most recent published versions of the `rhel-system-roles` and the `ansible-core` packages followed by executing an ansible playbook that includes any of the packaged roles, see below example:

      1. Install packages with appstream and baseos repos enabled:

      [root@localhost ~]# yum repolist
      Updating Subscription Management repositories.
      repo id                                                                                                                     repo name
      rhel-9-for-aarch64-appstream-rpms                                                                                           Red Hat Enterprise Linux 9 for ARM 64 - AppStream (RPMs)
      rhel-9-for-aarch64-baseos-rpms                                                                                              Red Hat Enterprise Linux 9 for ARM 64 - BaseOS (RPMs)
      [root@localhost ~]# yum install rhel-system-roles
      Updating Subscription Management repositories.
      Red Hat Enterprise Linux 9 for ARM 64 - BaseOS (RPMs)                                                                                                                                                                                          33 MB/s |  69 MB     00:02
      Red Hat Enterprise Linux 9 for ARM 64 - AppStream (RPMs)                                                                                                                                                                                       34 MB/s |  62 MB     00:01
      Last metadata expiration check: 0:00:04 ago on Wed 28 May 2025 01:09:29 PM PDT.
      Dependencies resolved.
      ==============================================================================================================================================================================================================================================================================
       Package                                                           Architecture                                         Version                                                          Repository                                                                      Size
      ==============================================================================================================================================================================================================================================================================
      Installing:
       rhel-system-roles                                                 noarch                                               1.95.7-0.1.el9_6                                                 rhel-9-for-aarch64-appstream-rpms                                              4.2 M
      Installing dependencies:
       ansible-core                                                      aarch64                                              1:2.14.18-1.el9                                                  rhel-9-for-aarch64-appstream-rpms                                              2.6 M
      
      <snip>
      
      Installed products updated.Installed:
        ansible-core-1:2.14.18-1.el9.aarch64  git-core-2.47.1-2.el9_6.aarch64        python3-cffi-1.14.5-5.el9.aarch64          python3-cryptography-36.0.1-4.el9.aarch64  python3-packaging-20.9-5.el9.noarch  python3-ply-3.11-14.el9.noarch  python3-pycparser-2.20-6.el9.noarch
        python3-pyparsing-2.4.7-9.el9.noarch  python3-resolvelib-0.5.4-5.el9.noarch  rhel-system-roles-1.95.7-0.1.el9_6.noarch  sshpass-1.09-4.el9.aarch64
      
      Complete!
      

      2. Create a simple playbook to execute an arbitrary role

      [root@localhost ~]# cat playbook.yaml
      ---
      - hosts: localhost
        become: true
        roles:
          - redhat.rhel_system_roles.sshd
      

      3. Execute playbook and observe that the logged error.

      [root@localhost ~]# ansible-playbook -c local -i localhost, ./playbook.yaml
      [WARNING]: Collection redhat.rhel_system_roles does not support Ansible version 2.14.18
      
      PLAY [localhost] *************************************************************************************************************************************************************************************************************************************************************
      
      TASK [Gathering Facts] *******************************************************************************************************************************************************************************************************************************************************
      ok: [localhost]
      < snip >
      

      4. Check rpm dependencies

      [root@localhost ~]# rpm -q --requires rhel-system-roles
      (ansible-core >= 2.11.0 or ansible >= 2.9.0)
      /bin/bash
      /bin/sh
      /usr/bin/env
      /usr/bin/python
      rpmlib(BuiltinLuaScripts) <= 4.2.2-1
      rpmlib(CompressedFileNames) <= 3.0.4-1
      rpmlib(FileDigests) <= 4.6.0-1
      rpmlib(PayloadFilesHavePrefix) <= 4.0-1
      rpmlib(PayloadIsZstd) <= 5.4.18-1
      rpmlib(RichDependencies) <= 4.12.0-1
      
      [root@localhost ~]# rpm -q --provides ansible-core
      ansible-core = 1:2.14.18-1.el9
      ansible-core(aarch-64) = 1:2.14.18-1.el9
      bundled(python-backports-ssl_match_hostname) = 3.7.0.1
      bundled(python-distro) = 1.6.0
      bundled(python-jinja2) = 3.1.2
      bundled(python-markupsafe) = 2.1.2
      bundled(python-selectors2) = 1.1.1
      bundled(python-six) = 1.16.0
      config(ansible-core) = 1:2.14.18-1.el9
      python3.9dist(ansible-core) = 2.14.18
      python3dist(ansible-core) = 2.14.18
      

      5. Demonstrate that the ansible collection runtime metadata requires a version different than is specified by the rpm metadata and is unsatisfiable with any package available in the appstream or baseos repos:

      [root@localhost ~]# cat /usr/share/ansible/collections/ansible_collections/redhat/rhel_system_roles/meta/runtime.yml
      ---
      requires_ansible: ">=2.15.0"
      
      [root@localhost ~]# yum whatprovides 'ansible-core >= 1:2.15.0'
      Updating Subscription Management repositories.
      Last metadata expiration check: 0:21:16 ago on Wed 28 May 2025 01:17:24 PM PDT.
      Error: No matches found. If searching for a file, try specifying the full path or using a wildcard prefix ("*/") at the beginning.
      

              rmeggins@redhat.com Richard Megginson
              craigslistsystems System Administrator (Inactive)
              Richard Megginson Richard Megginson
              David Jez David Jez
              Votes:
              1 Vote for this issue
              Watchers:
              12 Start watching this issue

                Created:
                Updated:
                Resolved: