My Ansible script worked until I updated to RHEL 9.2 today, now from the following line of the script: ``` - name: Add the el9 Lazygit repository community.general.copr: name: atim/lazygit chroot: "epel-9-{{ ansible_architecture }}" ``` I get (lappy is my laptop's name): ``` The full traceback is: Traceback (most recent call last): File "/tmp/ansible_community.general.copr_payload_q9bqhct1/ansible_community.general.copr_payload.zip/ansible_collections/community/general/plugins/modules/copr.py", line 81, in <module> ModuleNotFoundError: No module named 'dnf' fatal: [localhost]: FAILED! => { "changed": false, "invocation": { "module_args": { "chroot": "epel-9-x86_64", "host": "copr.fedorainfracloud.org", "name": "atim/lazygit", "protocol": "https", "state": "enabled" } }, "msg": "Failed to import the required Python library (dnf) on lappy's Python /usr/bin/python3.11. 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" } ``` `ansible-collection-community-general` is stuck on version 4.8.9, why not update it to the latest version 7? That might cure this problem, and a large number of other bugs that have been fixed.
> `ansible-collection-community-general` is stuck on version 4.8.9, why not update it to the latest version 7? That might cure this problem, and a large number of other bugs that have been fixed. This is the not the culprit of the issue, but I am planning to update to version 7 prior to the releases of RHEL 8.9 and 9.3. The problem here is that ansible-core in RHEL 9.2 is packaged for python3.11 instead of the system python3 (3.9) python interpreter[0]. The dnf module is only available for the system interpreter. I have submitted an upstream PR to community.general to make the copr module "respawn" itself to the correct interpreter if `ansible_python_interpreter` is not the default system interpreter[1]. `ansible_python_interpreter` is the Python interpreter that ansible uses to run modules on the target system. When running against localhost, this may or may not be the same interpreter used to run the ansible controller. In the meantime, you can add `localhost` to your ansible inventory [2] instead of using implicit localhost [3] so ansible will run interpreter discovery [4] and set `ansible_python_interpreter` to `/usr/bin/python3`. Alternatively, you can set the `ansible_python_interpreter` var to `/usr/bin/python3` yourself. [0] https://lists.fedoraproject.org/archives/list/epel-devel@lists.fedoraproject.org/thread/2MAGEGNYTGIPQLMYDJHNS2E5MQ5P35XD/ [1] https://github.com/ansible-collections/community.general/pull/6522 [2] https://docs.ansible.com/ansible/latest/inventory_guide/intro_inventory.html [3] https://docs.ansible.com/ansible/latest/inventory/implicit_localhost.html [4] https://docs.ansible.com/ansible/devel/reference_appendices/interpreter_discovery.html
FEDORA-EPEL-2023-1d7558ca69 has been submitted as an update to Fedora EPEL 9. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2023-1d7558ca69
Thanks for addressing this so quickly!
FEDORA-EPEL-2023-1d7558ca69 has been pushed to the Fedora EPEL 9 testing repository. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2023-1d7558ca69 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-EPEL-2023-1d7558ca69 has been pushed to the Fedora EPEL 9 stable repository. If problem still persists, please make note of it in this bug report.