"slice indices must be integers or None" Satellite Ansible Collection Role content_view_version_cleanup
Issue
- Using the Satellite Ansible Collection scripts source here https://github.com/RedHatSatellite/satellite-ansible-collection
- Using the
content_view_version_cleanuprole, receiving the following error:
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.