Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plugin: redhat.satellite.foreman not creating inventory groups for lifecycle_environments in Satellite 6.14 #1719

Open
toharris-rh opened this issue Mar 11, 2024 · 0 comments

Comments

@toharris-rh
Copy link

SUMMARY

Due to the internal structure of the content facets changing in Satellite 6.14, the redhat.satellite.foreman module used for creating the Ansible Inventory is no longer creating the lifecycle_ group names by default. A workaround has been found by defining a keyed group, but this was not required before.

ISSUE TYPE
  • Bug Report
    I believe the default keyed_groups in the redhat.satellite foreman module are using something like this:
    keyed_groups:
  • key: foreman_content_facet_attributes.lifecycle_environment_name, which works fine in 6.13 because the facet attribute looks like this:
    foreman_content_facet_attributes.lifecycle_environment_name

In 6.14 it looks like it changed to this (with a . instead of _ due to structure change):
foreman_content_facet_attributes.lifecycle_environment.name

ANSIBLE VERSION
tested on ansible [core 2.15.3] and ansible [core 2.14.2]
COLLECTION VERSION
redhat.satellite            3.14.0 
KATELLO/FOREMAN VERSION
package tfm-rubygem-katello is not installed
foreman-3.7.0.11-2.el8sat.noarch
STEPS TO REPRODUCE

Login to AAP
Add a Red Hat Satellite 6 Credential
Inventory -> Add Inventory
Click on Source for the inventory and add a Red Hat Satellite 6 Inventory source with the credentials created earlier
Sync the source
Check groups tab of the Satellite inventory and you will not see the lifecycle environments in the form of foreman_lifecycle_$name

Repeat the same against a Satellite 6.13
When you click the groups tab here you will see a lot more like foreman_content_view_$CVNAME and foreman_lifecycle_environment_$ENVNAME

EXPECTED RESULTS

My workflows used to leverage the dynamic groups created in Satellite for automated patch and content management, now the filter_group being used in the "Limit" on the templates will cause the jobs to return no hosts match.

ACTUAL RESULTS

Inventory job runs successfully, but does not return the expected groups

Workaround - (people will need to know to use the .name not _name which it was previously):

keyed_groups:

  • key: foreman_content_facet_attributes.lifecycle_environment.name | lower
    prefix: 'foreman_lifecycle_environment_'
    separator: ''

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant