theforeman / foreman-ansible-modules

Ansible modules for interacting with the Foreman API and various plugin APIs such as Katello
GNU General Public License v3.0
145 stars 162 forks source link

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

Open toharris-rh opened 3 months ago

toharris-rh commented 3 months ago
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

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 foremanlifecycle$name

Repeat the same against a Satellite 6.13 When you click the groups tab here you will see a lot more like foreman_contentview$CVNAME and foreman_lifecycleenvironment$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: