Skip to content

add: ansible type definition#854

Open
anweshadas wants to merge 3 commits intopackage-url:mainfrom
anweshadas:ansible
Open

add: ansible type definition#854
anweshadas wants to merge 3 commits intopackage-url:mainfrom
anweshadas:ansible

Conversation

@anweshadas
Copy link
Copy Markdown

@anweshadas anweshadas commented Apr 6, 2026

Fixes #853 add new PURL type ansible for identifying Ansible collections.

Ansible collections can be installed from multiple sources:

  • Ansible Galaxy (default)
  • Red Hat Automation Hub
  • Git repositories
  • Direct URLs/tarballs
  • System packages (RPM/deb)

This type definition enables scanners to generate accurate PURLs for Ansible collections in SBOMs and vulnerability databases.

Qualifiers:

  • repository_url: Alternative Galaxy-compatible server
  • vcs_url: VCS URL for git-sourced collections
  • download_url: Direct tarball URL
  • packaging: Distribution method (rpm, deb)

A corresponding change to ansible-core will be submitted to write the required metadata during collection installation, enabling scanners to determine the installation source.

Fixes package-url#853 add new PURL type `ansible` for identifying
Ansible collections.

Ansible collections can be installed from multiple sources:
- Ansible Galaxy (default)
- Red Hat Automation Hub
- Git repositories
- Direct URLs/tarballs
- System packages (RPM/deb)

This type definition enables scanners to generate accurate PURLs for
Ansible collections in SBOMs and vulnerability databases.

Qualifiers:
- repository_url: Alternative Galaxy-compatible server
- vcs_url: VCS URL for git-sourced collections
- download_url: Direct tarball URL
- packaging: Distribution method (rpm, deb)

A corresponding change to ansible-core will be submitted to write
source.json metadata during collection installation, enabling
scanners to determine the installation source.
anweshadas added a commit to anweshadas/ansible that referenced this pull request Apr 7, 2026
Add source.json file creation when installing collections via ansible-galaxy.

This enables SBOM scanners (like Syft) to generate accurate Package URLs
(PURLs) for Ansible collections by recording the installation source.

The source.json file is written to the collection directory and contains:
- format_version: Schema version (1.0.0)
- namespace, name, version: Collection identity
- type: Installation source type (galaxy, git, url, file, dir)
- repository_url: Galaxy-compatible server URL (for galaxy type)
- download_url: Direct artifact URL (for galaxy/url types)
- vcs_url: VCS URL with git+ prefix (for git type)

Examples:
- Galaxy: type=galaxy, repository_url=https://galaxy.ansible.com
- Automation Hub: type=galaxy, repository_url=https://console.redhat.com/api/automation-hub/
- Git: type=git, vcs_url=git+https://github.com/org/repo.git@tag
- URL: type=url, download_url=https://example.com/collection.tar.gz
- Local: type=file or type=dir (no path stored)

This change supports the new 'ansible' PURL type being proposed at:
package-url/purl-spec#854
anweshadas added a commit to anweshadas/ansible that referenced this pull request Apr 7, 2026
Add source.json file creation when installing collections via ansible-galaxy.

This enables SBOM scanners (like Syft) to generate accurate Package URLs
(PURLs) for Ansible collections by recording the installation source.

The source.json file is written to the collection directory and contains:
- format_version: Schema version (1.0.0)
- namespace, name, version: Collection identity
- type: Installation source type (galaxy, git, url, file, dir)
- repository_url: Galaxy-compatible server URL (for galaxy type)
- download_url: Direct artifact URL (for galaxy/url types)
- vcs_url: VCS URL with git+ prefix (for git type)

Examples:
- Galaxy: type=galaxy, repository_url=https://galaxy.ansible.com
- Automation Hub: type=galaxy, repository_url=https://console.redhat.com/api/automation-hub/
- Git: type=git, vcs_url=git+https://github.com/org/repo.git@tag
- URL: type=url, download_url=https://example.com/collection.tar.gz
- Local: type=file or type=dir (no path stored)

This change supports the new 'ansible' PURL type being proposed at:
package-url/purl-spec#854
anweshadas added a commit to anweshadas/ansible that referenced this pull request Apr 7, 2026
Add source.json file creation when installing collections via ansible-galaxy.

This enables SBOM scanners (like Syft) to generate accurate Package URLs
(PURLs) for Ansible collections by recording the installation source.

The source.json file is written to the collection directory and contains:
- format_version: Schema version (1.0.0)
- namespace, name, version: Collection identity
- type: Installation source type (galaxy, git, url, file, dir)
- repository_url: Galaxy-compatible server URL (for galaxy type)
- download_url: Direct artifact URL (for galaxy/url types)
- vcs_url: VCS URL with git+ prefix (for git type)

Examples:
- Galaxy: type=galaxy, repository_url=https://galaxy.ansible.com
- Automation Hub: type=galaxy, repository_url=https://console.redhat.com/api/automation-hub/
- Git: type=git, vcs_url=git+https://github.com/org/repo.git@tag
- URL: type=url, download_url=https://example.com/collection.tar.gz
- Local: type=file or type=dir (no path stored)

This change supports the new 'ansible' PURL type being proposed at:
package-url/purl-spec#854
anweshadas added a commit to anweshadas/ansible that referenced this pull request Apr 7, 2026
Add source.json file creation when installing collections via ansible-galaxy.

This enables SBOM scanners (like Syft) to generate accurate Package URLs
(PURLs) for Ansible collections by recording the installation source.

The source.json file is written to the collection directory and contains:
- format_version: Schema version (1.0.0)
- namespace, name, version: Collection identity
- type: Installation source type (galaxy, git, url, file, dir)
- repository_url: Galaxy-compatible server URL (for galaxy type)
- download_url: Direct artifact URL (for galaxy/url types)
- vcs_url: VCS URL with git+ prefix (for git type)

Examples:
- Galaxy: type=galaxy, repository_url=https://galaxy.ansible.com
- Automation Hub: type=galaxy, repository_url=https://console.redhat.com/api/automation-hub/
- Git: type=git, vcs_url=git+https://github.com/org/repo.git@tag
- URL: type=url, download_url=https://example.com/collection.tar.gz
- Local: type=file or type=dir (no path stored)

This change supports the new 'ansible' PURL type being proposed at:
package-url/purl-spec#854
anweshadas added a commit to anweshadas/ansible that referenced this pull request Apr 7, 2026
Add source.json file creation when installing collections via ansible-galaxy.

This enables SBOM scanners (like Syft) to generate accurate Package URLs
(PURLs) for Ansible collections by recording the installation source.

The source.json file is written to the collection directory and contains:
- format_version: Schema version (1.0.0)
- namespace, name, version: Collection identity
- type: Installation source type (galaxy, git, url, file, dir)
- repository_url: Galaxy-compatible server URL (for galaxy type)
- download_url: Direct artifact URL (for galaxy/url types)
- vcs_url: VCS URL with git+ prefix (for git type)

Examples:
- Galaxy: type=galaxy, repository_url=https://galaxy.ansible.com
- Automation Hub: type=galaxy, repository_url=https://console.redhat.com/api/automation-hub/
- Git: type=git, vcs_url=git+https://github.com/org/repo.git@tag
- URL: type=url, download_url=https://example.com/collection.tar.gz
- Local: type=file or type=dir (no path stored)

This change supports the new 'ansible' PURL type being proposed at:
package-url/purl-spec#854
Comment thread types/ansible-definition.json Outdated
Comment thread types/ansible-definition.json Outdated
Comment thread types/ansible-definition.json Outdated
mjherzog and others added 2 commits April 16, 2026 09:35
Use Ansible's native comma syntax for VCS URL version references instead
of pip/SPDX @ syntax. ansible-galaxy uses a comma to separate the git
ref (e.g., git+https://...repo.git,tag), and the @ sign is treated as
part of the URL, causing installs to fail.

- Update vcs_url qualifier description and example to use comma separator
with real-world community.general collection
- Fix download_url example tarball name to match the "custom" namespace
- Add collections installing guide to reference_urls
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.

Register new PURL type: 'ansible' for Ansible Collections

3 participants