Skip to content

On dnf5 systems (e.g. Fedora 41) python3-rpm required + error message not descriptive #766

@felixhowe

Description

@felixhowe

If one installs linux-system-roles and then attempts to use linux-system-roles.network in a playbook, the play fails with the following error:

TASK [linux-system-roles.network : Check which packages are installed] *********
fatal: [localhost]: FAILED! => {"censored": "the output has been hidden due to
the fact that 'no_log: true' was specified for this result", "changed": false}

This bug was introduced in Fedora 41 and is probably related to the change to the dnf5 package manager in 41; linux-system-roles.network worked as expected immediately after install on Fedora 40.

To reproduce on a Fedora 41 machine, see attached minimal example playbook:

lsr.network_needs_python3-rpm.yml.txt

Specifically, the "no_log" value causing the "censored" error message is set in the following file:

/usr/share/ansible/roles/linux-system-roles.network/tasks/set_facts.yml

Commenting out "no_log: true" on the last line of that file (under "Check which packages are installed") changes the error message to a more descriptive one:

TASK [linux-system-roles.network : Check which packages are installed] *********
[WARNING]: Found "rpm" but Failed to import the required Python library (rpm) on
tdc-testvm's Python /usr/bin/python3. Please read the module documentation and
install it in the appropriate location. If the required library is installed,
but Ansible is using the wrong Python interpreter, please consult the
documentation on ansible_python_interpreter

If you install python3-rpm manually via:

dnf install python3-rpm

The playbook then executes normally and all tasks succeed.

Note that I'm filing this here instead of with Red Hat / Fedora because as any target remote hosts also need that package, it should probably be auto-installed by linux-system-roles.network when required.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions