Skip to content

Fix ansible collection author exceeding 64-character Galaxy limit#14846

Open
ggbecker wants to merge 3 commits into
ComplianceAsCode:masterfrom
ggbecker:fix-collection-author-length
Open

Fix ansible collection author exceeding 64-character Galaxy limit#14846
ggbecker wants to merge 3 commits into
ComplianceAsCode:masterfrom
ggbecker:fix-collection-author-length

Conversation

@ggbecker

@ggbecker ggbecker commented Jul 1, 2026

Copy link
Copy Markdown
Member

Description:

  • Fix collection author exceeding 64-character Galaxy limit
  • Remove email from COLLECTION_AUTHORS so the author string stays within the 64-character limit enforced by galaxy-importer.

Rationale:

  • Fixes:
Invalid collection metadata. Each author in 'authors' list must not be greater than 64 characters

  File "/venv/lib64/python3.12/site-packages/pulpcore/tasking/tasks.py", line 73, in _execute_task
    result = task_function()
             ^^^^^^^^^^^^^^^

Remove email from COLLECTION_AUTHORS so the author string stays
within the 64-character limit enforced by galaxy-importer.
@ggbecker ggbecker added this to the 0.1.82 milestone Jul 1, 2026
@ggbecker

ggbecker commented Jul 1, 2026

Copy link
Copy Markdown
Member Author

After attempting to import the collections again, it threw another error fixed by: 6ea20d6

The collections have now been published: https://galaxy.ansible.com/ui/repo/published/redhatofficial/rhel_hardening_roles/

@ggbecker

ggbecker commented Jul 1, 2026

Copy link
Copy Markdown
Member Author

I added one more commit: f57855f

To improve how the documentation is displayed, especially for the name of the roles and how they appear in the documentation for the collection, as it is slightly different than the individual ansible roles

@Mab879 Mab879 self-assigned this Jul 1, 2026
Comment thread utils/ansible_roles_to_collection.py Outdated
def generate_runtime_yml(collection_dir):
"""Write meta/runtime.yml declaring the minimum required Ansible version."""
try:
from ssg.constants import min_ansible_version

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this needed, seems this requires the ssg module.

$ python ./utils/ansible_roles_to_collection.py 
Unable to find the ssg module. Please run 'source .pyenv.sh'

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if I understand what is being asked here. Is it the case we should add the ImportError message stating that the user needs to use the source .pyenv.sh

or are you suggesting to remove the import of min_ansible_version and use directly 2.9

I think importing the min_ansible_version from the ssg.constants is the right approach as it would rely on what we use for our ansible playbooks.

I can throw the error message that user needs to source .pyenv.sh

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The script already fails to run if don't have the ssg module, so no need for the try catch.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, so we can remove it and let it fail in case they haven't sourced the right files.

ggbecker added 2 commits July 9, 2026 17:33
The galaxy-importer requires requires_ansible in meta/runtime.yml.
Add generation of this file using ssg.constants.min_ansible_version
as the minimum version (falls back to 2.9 if ssg is not importable).
The roles are generated with standalone Galaxy references
(RedHatOfficial.rhel9_stig). When bundled into a collection those
references are wrong. After copying each role, rewrite its README to:
- Use the collection FQCN (redhatofficial.rhel_hardening_roles.rhel9_stig)
- Fix the broken relative link to defaults/main.yml which does not
  resolve in the Galaxy collection UI
@ggbecker ggbecker force-pushed the fix-collection-author-length branch from a341b91 to 171ec2c Compare July 9, 2026 15:37
@openshift-ci

openshift-ci Bot commented Jul 9, 2026

Copy link
Copy Markdown

@ggbecker: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-aws-openshift-platform-compliance 171ec2c link true /test e2e-aws-openshift-platform-compliance
ci/prow/e2e-aws-openshift-node-compliance 171ec2c link true /test e2e-aws-openshift-node-compliance

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

fqcn = f"{namespace}.{collection_name}.{role_name}"

# Replace standalone install instruction and role reference
import re

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move to top of file

os.makedirs(os.path.join(collection_dir, subdir), exist_ok=True)
return collection_dir


def generate_runtime_yml(collection_dir):
"""Write meta/runtime.yml declaring the minimum required Ansible version."""
from ssg.constants import min_ansible_version

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move imports to top of file.

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

Successfully merging this pull request may close these issues.

2 participants