This script will contact the Ansible Galaxy API to fetch information about an Ansible Collection, and use that to build an RPM spec file.
- Jinja2
- pbr
- requests
The script is provided as a Python package. You can install it on a local virtual environment, or as an RPM package. There is a Copr repository ready to use:
$ sudo dnf copr enable jpena/galaxy-collection-to-rpm
$ sudo dnf install galaxycollection-to-rpm
You can also run python galaxycollection_to_rpm/galaxycollection_to_rpm.py
directly if needed, from the git checkout.
$ galaxy-collection-to-rpm --collection <collection-name>
This command-line will send the resulting spec file to standard output. You can also specify the target file using:
$ galaxy-collection-to-rpm --collection <collection-name> --output-file file.spec
Make sure you check the generated spec file, since some fields may require adjustments. One example is the license, which may not be using the names required by the packaging guidelines.
Apache 2.0
Javier Peña (@fj_pena)