ansible.posix icon indicating copy to clipboard operation
ansible.posix copied to clipboard

rhel_rpm_ostree fails to find "aliased" packages, does not take Provides into account

Open richm opened this issue 10 months ago • 3 comments

SUMMARY

The rhel_rpm_ostree package provider does not find packages that are installed via their alias - that is - a name that is in the Provides for an RPM package. It basically does an rpm -q $pkg_name which fails if the name of the package does not match what the user passed to the package module.

on a cs8 system:

# dnf install libselinux-python3
...
Installing:
 python3-libselinux        x86_64        2.9-8.el8          baseos        283 k
...
Installed:
  python3-libselinux-2.9-8.el8.x86_64                                           
# rpm -q --whatprovides libselinux-python3
python3-libselinux-2.9-8.el8.x86_64
# rpm -q --whatprovides python3-libselinux
python3-libselinux-2.9-8.el8.x86_64

Using the package module on an ostree system

package:
  name: [libselinux-python3, policycoreutils-python3]

gives an error like this:

fatal: [centos-9-ostree.qcow2]: FAILED! => {
    "changed": false
} 
  
MSG:

libselinux-python3The following packages are absent in the currently booted rpm-ostree commit: %s policycoreutils-python3

(the error message is also misformatted).

ISSUE TYPE
  • Bug Report
COMPONENT NAME
ANSIBLE VERSION
ansible [core 2.15.4]
  config file = /home/rmeggins/.ansible.cfg
  configured module search path = ['/home/rmeggins/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/rmeggins/linux-system-roles/logging/.tox/qemu-ansible-core-2.15/lib/python3.11/site-packages/ansible
  ansible collection location = /home/rmeggins/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/rmeggins/linux-system-roles/logging/.tox/qemu-ansible-core-2.15/bin/ansible
  python version = 3.11.4 (main, Jun  7 2023, 00:00:00) [GCC 13.1.1 20230511 (Red Hat 13.1.1-2)] (/home/rmeggins/linux-system-roles/logging/.tox/qemu-ansible-core-2.15/bin/python)
  jinja version = 3.1.2
  libyaml = True
COLLECTION VERSION
Collection    Version
------------- -------
ansible.posix 1.5.4  
CONFIGURATION
CONFIG_FILE() = /home/rmeggins/.ansible.cfg
EDITOR(env: EDITOR) = vi
OS / ENVIRONMENT

centos stream 8 and 9 control node

STEPS TO REPRODUCE

Build a cs8 or cs9 ostree system with libselinux-python3, policycoreutils-python3 installed

package:
  name: [libselinux-python3, policycoreutils-python3]
EXPECTED RESULTS

I expect rhel_rpm_ostree to work like the package module providers on non-ostree systems.

ACTUAL RESULTS
fatal: [centos-9-ostree.qcow2]: FAILED! => {
    "changed": false
} 
  
MSG:

libselinux-python3The following packages are absent in the currently booted rpm-ostree commit: %s policycoreutils-python3

richm avatar Sep 15 '23 23:09 richm

@maxamillion fyi

richm avatar Sep 15 '23 23:09 richm

@richm ack, going to need a different method of sorting this out. Thanks for the info!

maxamillion avatar Sep 15 '23 23:09 maxamillion

@richm this is relevant as a potential path forward -> https://github.com/ansible/ansible/pull/82629

maxamillion avatar Jan 31 '24 23:01 maxamillion