Fix ansible collection author exceeding 64-character Galaxy limit#14846
Fix ansible collection author exceeding 64-character Galaxy limit#14846ggbecker wants to merge 3 commits into
Conversation
Remove email from COLLECTION_AUTHORS so the author string stays within the 64-character limit enforced by galaxy-importer.
|
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/ |
|
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 |
| def generate_runtime_yml(collection_dir): | ||
| """Write meta/runtime.yml declaring the minimum required Ansible version.""" | ||
| try: | ||
| from ssg.constants import min_ansible_version |
There was a problem hiding this comment.
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'
There was a problem hiding this comment.
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
There was a problem hiding this comment.
The script already fails to run if don't have the ssg module, so no need for the try catch.
There was a problem hiding this comment.
I see, so we can remove it and let it fail in case they haven't sourced the right files.
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
a341b91 to
171ec2c
Compare
|
@ggbecker: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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 |
| 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 |
There was a problem hiding this comment.
Please move imports to top of file.
Description:
Rationale: