Ansible Roles website screenshot

Ansible Roles

A curated collection of APIs and resources for discovering, managing, and consuming Ansible roles — the primary unit of reusable automation content in the Ansible ecosystem. Covers the Galaxy and Automation Hub APIs for role discovery, download, and publishing, as well as the Ansible Collections framework that has extended the role model into full-featured content packages.

3 APIs 5 Features
AnsibleAutomationCollectionsConfiguration ManagementDevOpsInfrastructure As CodeRoles

APIs

Ansible Galaxy Roles API

The Ansible Galaxy v1 and v2 REST API enables searching, discovering, and downloading Ansible roles contributed by the community. Supports searching roles by keyword, author, or...

Ansible Galaxy Collections API

The Ansible Galaxy v3 API provides enhanced support for Ansible collections — the modern packaging format that bundles roles, modules, plugins, and documentation together. Suppo...

Ansible Automation Hub Roles API

The Red Hat Ansible Automation Hub provides certified and partner-validated Ansible collections and roles for enterprise use. The API enables access to Red Hat-certified content...

Collections

Pricing Plans

Rate Limits

Ansible Roles Rate Limits

5 limits

RATE LIMITS

FinOps

Features

Role Search and Discovery

Search Galaxy for community-contributed roles by keyword, author, namespace, or tag to find reusable automation content.

Collection Packaging

Bundle roles, modules, plugins, and documentation into distributable collection packages versioned and published via the Galaxy API.

Version Management

Access specific versions of roles and collections, enabling pinned dependency management in Ansible projects.

Certified Content

Access Red Hat-certified and partner-validated Ansible collections with enterprise-grade quality assurance via Automation Hub.

Namespace Management

Manage author namespaces on Galaxy to publish and maintain role and collection content under a consistent identity.

Use Cases

Role Reuse Across Projects

Discover and install community roles from Galaxy to avoid reinventing automation logic for common tasks like nginx, MySQL, or Kubernetes setup.

Certified Enterprise Automation

Use Red Hat-certified collections from Automation Hub in production environments where quality assurance and support are required.

Private Content Distribution

Publish internal roles and collections to a private Automation Hub instance for controlled distribution within an organization.

Dependency Management

Pin role and collection versions in requirements.yml files and install them via the Galaxy API in CI/CD pipelines.

Integrations

Ansible Playbooks

Use roles discovered via the Galaxy API directly in Ansible playbooks with the roles directive or include_role task.

Ansible Automation Platform

Synchronize collections from Galaxy or Automation Hub into Ansible Automation Platform for use in job templates.

Requirements Files

Define role and collection dependencies in requirements.yml and install them automatically via ansible-galaxy CLI using the API.

Semantic Vocabularies

Ansible Roles Context

4 classes · 16 properties

JSON-LD

JSON Structure

Ansible Roles Collection Structure

13 properties

JSON STRUCTURE

Ansible Roles Role Structure

15 properties

JSON STRUCTURE

Example Payloads

Ansible Roles Role Example

15 fields

EXAMPLE

Resources

🚀
GettingStarted
GettingStarted
🔑
Authentication
Authentication
📜
TermsOfService
TermsOfService
📜
PrivacyPolicy
PrivacyPolicy
👥
GitHubRepository
GitHubRepository
👥
GitHubOrganization
GitHubOrganization
🔗
Role Schema
JSONSchema
🔗
Collection Schema
JSONSchema
🔗
Vocabulary
Vocabulary

Sources

apis.yml Raw ↑
opencollection: 1.0.0
info:
  name: Ansible Galaxy Roles & Collections API
  version: '1'
items:
- info:
    name: Default
    type: folder
  items:
  - info:
      name: API root
      type: http
    http:
      method: GET
      url: https://galaxy.ansible.com/api/
    docs: Lists available API versions (v1, v3, pulp v3).
  - info:
      name: Legacy v1 root
      type: http
    http:
      method: GET
      url: https://galaxy.ansible.com/api/v1/
    docs: Lists the v1 endpoints (roles, users, namespaces, imports, sync).
- info:
    name: Roles
    type: folder
  items:
  - info:
      name: Search community roles
      type: http
    http:
      method: GET
      url: https://galaxy.ansible.com/api/v1/roles/
      params:
      - name: page
        value: ''
        type: query
      - name: page_size
        value: ''
        type: query
      - name: owner__username
        value: ''
        type: query
        description: Filter by GitHub username of the role owner.
      - name: name
        value: ''
        type: query
        description: Filter by role name (substring match).
      - name: keyword
        value: ''
        type: query
        description: Free-text keyword search.
      - name: tag
        value: ''
        type: query
        description: Filter by tag (galaxy_tags).
      - name: platforms
        value: ''
        type: query
        description: Filter by supported platform name.
      - name: namespace
        value: ''
        type: query
    docs: Search community roles
  - info:
      name: Retrieve a role
      type: http
    http:
      method: GET
      url: https://galaxy.ansible.com/api/v1/roles/:id/
      params:
      - name: id
        value: ''
        type: path
    docs: Retrieve a role
  - info:
      name: List role versions
      type: http
    http:
      method: GET
      url: https://galaxy.ansible.com/api/v1/roles/:id/versions/
      params:
      - name: id
        value: ''
        type: path
    docs: List role versions
  - info:
      name: Increment a role download counter
      type: http
    http:
      method: POST
      url: https://galaxy.ansible.com/api/v1/roles/:id/downloads/
      params:
      - name: id
        value: ''
        type: path
    docs: Increment a role download counter
- info:
    name: Users
    type: folder
  items:
  - info:
      name: List users
      type: http
    http:
      method: GET
      url: https://galaxy.ansible.com/api/v1/users/
    docs: List users
  - info:
      name: Retrieve a user
      type: http
    http:
      method: GET
      url: https://galaxy.ansible.com/api/v1/users/:id/
      params:
      - name: id
        value: ''
        type: path
    docs: Retrieve a user
- info:
    name: Namespaces
    type: folder
  items:
  - info:
      name: List namespaces
      type: http
    http:
      method: GET
      url: https://galaxy.ansible.com/api/v1/namespaces/
    docs: List namespaces
  - info:
      name: Retrieve a namespace
      type: http
    http:
      method: GET
      url: https://galaxy.ansible.com/api/v1/namespaces/:id/
      params:
      - name: id
        value: ''
        type: path
    docs: Retrieve a namespace
- info:
    name: Imports
    type: folder
  items:
  - info:
      name: List role import jobs
      type: http
    http:
      method: GET
      url: https://galaxy.ansible.com/api/v1/imports/
      params:
      - name: role_id
        value: ''
        type: query
      - name: state
        value: ''
        type: query
    docs: List role import jobs
  - info:
      name: Trigger a role import
      type: http
    http:
      method: POST
      url: https://galaxy.ansible.com/api/v1/imports/
      body:
        type: json
        data: '{}'
    docs: Trigger a role import
  - info:
      name: Retrieve a role import job
      type: http
    http:
      method: GET
      url: https://galaxy.ansible.com/api/v1/imports/:id/
      params:
      - name: id
        value: ''
        type: path
    docs: Retrieve a role import job
- info:
    name: Sync
    type: folder
  items:
  - info:
      name: Trigger a content sync
      type: http
    http:
      method: POST
      url: https://galaxy.ansible.com/api/v1/sync/
    docs: Trigger a content sync
- info:
    name: Collections
    type: folder
  items:
  - info:
      name: List collections
      type: http
    http:
      method: GET
      url: https://galaxy.ansible.com/api/v3/collections/
    docs: List collections
  - info:
      name: Retrieve a collection
      type: http
    http:
      method: GET
      url: https://galaxy.ansible.com/api/v3/collections/:namespace/:name/
      params:
      - name: namespace
        value: ''
        type: path
      - name: name
        value: ''
        type: path
    docs: Retrieve a collection
  - info:
      name: List collection versions
      type: http
    http:
      method: GET
      url: https://galaxy.ansible.com/api/v3/collections/:namespace/:name/versions/
      params:
      - name: namespace
        value: ''
        type: path
      - name: name
        value: ''
        type: path
    docs: List collection versions
  - info:
      name: Retrieve a collection version
      type: http
    http:
      method: GET
      url: https://galaxy.ansible.com/api/v3/collections/:namespace/:name/versions/:version/
      params:
      - name: namespace
        value: ''
        type: path
      - name: name
        value: ''
        type: path
      - name: version
        value: ''
        type: path
    docs: Retrieve a collection version
bundled: true