Add local ansible Galaxy repositories (#157)

Internal Ansible collections can only be installed from galaxy.ansible.com through the remote; there is nowhere to publish them for ansible-galaxy.

- add the Galaxy v3 publish endpoint (multipart, base64 parts) with an import task that is already completed
- read collection_info from MANIFEST.json under size and decompression caps, rejecting escaping paths and links
- serve collection, paginated versions (root-relative links, as Galaxy does), version detail and artifact downloads
- reject an existing namespace.name:version with 409
- add docs/ansible/local.md, a UI snippet and an e2e-docker case driving real ansible-galaxy

requires unkin/artifactapi#137

Reviewed-on: #157
Co-authored-by: unkin-agent <unkin-agent@unkin.net>
Co-committed-by: unkin-agent <unkin-agent@unkin.net>
This commit was merged in pull request #157.
This commit is contained in:
2026-10-18 18:01:09 +11:00
committed by BenVincent
parent ca08c580b8
commit a00e45c3a7
11 changed files with 1232 additions and 3 deletions
+13 -1
View File
@@ -2,7 +2,19 @@ import type { PackageTypeUI } from '../types';
const def: PackageTypeUI = {
color: 'red',
snippets: ({ proxy }) => {
snippets: ({ name, url, proxy, isLocal }) => {
if (isLocal) {
const src = `${url}/api/v1/local/${name}/`;
return [
{
title: 'Publish and install',
language: 'bash',
code: `ansible-galaxy collection publish <ns>-<name>-<version>.tar.gz --server ${src} --api-key unused
ansible-galaxy collection install <ns>.<name> --server ${src}`,
note: 'publish needs an API key; any value works. Publishing an existing version is rejected.',
},
];
}
return [
{
title: 'Install collections through this Galaxy proxy',