Interview Prep/Ansible/Roles, Collections and Galaxy

How do you build and publish your own collection?

AdvancedConceptRoles, Collections and Galaxy
Answer
ansible-galaxy collection init myorg.platform
cd myorg/platform && ansible-galaxy collection build
# -> myorg-platform-1.0.0.tar.gz
ansible-galaxy collection publish myorg-platform-1.0.0.tar.gz \
  --server https://galaxy.example.com --api-key "$GALAXY_TOKEN"

Before publishing: bump version in galaxy.yml, run ansible-test sanity, ansible-lint, add a changelog, and set build_ignore to exclude test and CI files. For internal sharing, configure a private Galaxy (Automation Hub or Pulp) under [galaxy_server.*] in ansible.cfg.

All Ansible questions Roadmap: Ansible

More on Roles, Collections and Galaxy