"slice indices must be integers or None" Satellite Ansible Collection Role content_view_version_cleanup

Solution Verified - Updated -

Issue

TASK [redhat.satellite.content_view_version_cleanup : find and delete unused content view versions] *************************************
fatal: [localhost]: FAILED! => {"msg": "The conditional check '(cv.versions | rejectattr('environment_ids') | map(attribute='version') | reverse | list)[satellite_content_view_version_cleanup_keep:]' failed. The error was: Unexpected templating type error occurred on ({% if (cv.versions | rejectattr('environment_ids') | map(attribute='version') | reverse | list)[satellite_content_view_version_cleanup_keep:] %} True {% else %} False {% endif %}): slice indices must be integers or None or have an __index__ method\n\nThe error appears to be in '/usr/share/ansible/collections/ansible_collections/redhat/satellite/roles/content_view_version_cleanup/tasks/main.yml': line 30, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: \"find and delete unused content view versions\"\n  ^ here\n"}

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content