Ansible · Schema

Playbook

An Ansible playbook — a YAML file containing one or more plays that map a group of hosts to a set of roles and tasks.

AnsibleAutomationConfiguration ManagementDevOpsInfrastructure as CodeOpen-SourceOrchestrationRed Hat

Properties

Name Type Description
name string Human-readable name for the playbook play.
hosts string Host or group pattern targeted by this play.
become boolean Whether to run tasks with privilege escalation (sudo).
become_user string User to become when privilege escalation is enabled.
gather_facts boolean Whether to gather system facts before running tasks.
vars object Variables defined at the play level.
roles array List of roles applied to hosts in this play.
tasks array List of tasks executed in this play.
handlers array Handlers triggered by task notifications.
tags array Tags for selective task execution.
View JSON Schema on GitHub

JSON Schema

ansible-playbook-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/ansible/refs/heads/main/json-schema/ansible-playbook-schema.json",
  "title": "Playbook",
  "description": "An Ansible playbook — a YAML file containing one or more plays that map a group of hosts to a set of roles and tasks.",
  "type": "object",
  "properties": {
    "name": {"type": "string", "description": "Human-readable name for the playbook play.", "example": "Deploy Web Application"},
    "hosts": {"type": "string", "description": "Host or group pattern targeted by this play.", "example": "web-servers"},
    "become": {"type": "boolean", "description": "Whether to run tasks with privilege escalation (sudo).", "example": true},
    "become_user": {"type": "string", "description": "User to become when privilege escalation is enabled.", "example": "root"},
    "gather_facts": {"type": "boolean", "description": "Whether to gather system facts before running tasks.", "example": true},
    "vars": {"type": "object", "description": "Variables defined at the play level.", "additionalProperties": true},
    "roles": {"type": "array", "items": {"type": "string"}, "description": "List of roles applied to hosts in this play.", "example": ["nginx", "app-deploy"]},
    "tasks": {"type": "array", "description": "List of tasks executed in this play.", "items": {"$ref": "#/$defs/Task"}},
    "handlers": {"type": "array", "description": "Handlers triggered by task notifications.", "items": {"$ref": "#/$defs/Task"}},
    "tags": {"type": "array", "items": {"type": "string"}, "description": "Tags for selective task execution.", "example": ["deploy", "web"]}
  },
  "required": ["hosts"],
  "$defs": {
    "Task": {
      "type": "object",
      "properties": {
        "name": {"type": "string", "description": "Human-readable task description.", "example": "Install Nginx"},
        "module": {"type": "string", "description": "Ansible module name used by this task.", "example": "ansible.builtin.package"},
        "when": {"type": "string", "description": "Conditional expression for task execution.", "example": "ansible_os_family == 'RedHat'"},
        "tags": {"type": "array", "items": {"type": "string"}, "description": "Tags associated with this task."},
        "notify": {"type": "string", "description": "Handler name to notify upon task change.", "example": "restart nginx"}
      }
    }
  }
}

Work with this as data

Every JSON Schema here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for schemas

4 MCP tools reach this
  • find_json_schemasBrowse and filter every JSON Schema in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This JSON Schema
curl "https://apis.io/api/v1/json-schemas/ansible-playbook"
All schemas
curl "https://apis.io/api/v1/json-schemas?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.