Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2189687 - Ansible Satellite Collection Content View Filters incorrectly handles packages with different architectures
Summary: Ansible Satellite Collection Content View Filters incorrectly handles package...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Ansible Collection
Version: Unspecified
Hardware: All
OS: Linux
high
medium
Target Milestone: 6.15.0
Assignee: Evgeni Golov
QA Contact: Griffin Sullivan
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-04-25 22:32 UTC by Glenn Snead
Modified: 2024-04-23 17:14 UTC (History)
4 users (show)

Fixed In Version: ansible-collection-redhat-satellite-3.15.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2024-04-23 17:14:07 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Satellite Content View Screenshot (84.51 KB, image/png)
2023-04-25 22:32 UTC, Glenn Snead
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github theforeman foreman-ansible-modules pull 1679 0 None open handle rules for the same package but different arch/version conrrectly 2023-11-15 09:06:05 UTC
Red Hat Issue Tracker SAT-17543 0 None None None 2023-05-04 13:01:47 UTC
Red Hat Product Errata RHSA-2024:2010 0 None None None 2024-04-23 17:14:09 UTC

Description Glenn Snead 2023-04-25 22:32:48 UTC
Created attachment 1959934 [details]
Satellite Content View Screenshot

Description of problem: The redhat.satellite.content_view_filter or content_view_filter_rule component incorrectly handles duplicate package names when the second entry lists a different architecture


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


How reproducible:
Verified with this playbook:
- hosts: satellite
  gather_facts: no
  become: no
  vars:
    - rules:
        - { name: "cairo", version: "1.15.12-6", arch: "x86_64" }
        - { name: "cairo", version: "1.15.12-6", arch: "i686" }
  tasks:
    - name: Create Content Views
      redhat.satellite.content_view:
        server_url: "{{ server_url }}"
        username: '{{ satellite_username }}'
        password: '{{ satellite_password }}'
        organization: "Default Organization"
        name: RHEL8_Demo
        auto_publish: false
        state: present

    - name: Create Content View Filters
      redhat.satellite.content_view_filter:
        server_url: "{{ server_url }}"
        username: '{{ satellite_username }}'
        password: '{{ satellite_password }}'
        organization: "Default Organization"
        name: "{{ item.name }}"
        content_view: RHEL8_Demo
        name: "Packages"
        filter_state: present
        filter_type: "rpm"
        original_packages: True
        inclusion: True
        rule_name: "{{ item.name }}"
        version: "{{ item.version }}"
        architecture: "{{ item.arch }}"
      loop: "{{ rules }}"

Steps to Reproduce:
1. Set up Satellite and sync the RHEL 8 BaseOS and AppStream repositories
2. Run the provided playbook, providing the necessary variables for the target Satellite server
3. Check the created content view filter. Instead of two entries for cairo showing different architectures and a specific package release, it shows a single entry where the architecture is the last item submitted to Satellite, and the package release is "All versions." 

Actual results:
See screenshot

Expected results:
Two entries for the cario package, each with the specified package release and the specified package architecture.

Comment 1 Brad Buckingham 2023-10-30 11:29:29 UTC
Bulk setting Target Milestone = 6.15.0 where sat-6.15.0+ is set.

Comment 2 Evgeni Golov 2023-11-15 08:54:09 UTC
Two things:

1. your playbook has "name" twice for the filter module, and by default the last one wins.
2. the way you use it right now it overwrites the x86_64 filter with the i686 one in the loop, as you pass the same name for the filter in both cases (either "packages" or after fixing 1/ "cairo").

Now, you will notice that there is no other way to pass multiple rules into one filter with the content_view_filter module.
This is why we created the content_view_filter_rule module, but even that has a bug with architecture handling, so let's fix that :)

Comment 4 Griffin Sullivan 2024-01-03 14:24:50 UTC
Verified in 6.15.0 snap 4.0

content_view_filter_rule is able to create 2 separate rules for the same package that have different architectures.

Comment 7 errata-xmlrpc 2024-04-23 17:14:07 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: Satellite 6.15.0 release), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2024:2010


Note You need to log in before you can comment on or make changes to this bug.