ansible-playbook
TLDR
Run a playbook
SYNOPSIS
ansible-playbook [-i inventory] [-e vars] [--tags tags] [options] playbook.yml
DESCRIPTION
ansible-playbook executes Ansible playbooks, which are YAML files defining automation tasks. Playbooks can provision servers, deploy applications, configure services, and orchestrate complex multi-tier deployments.
Unlike ad-hoc ansible commands, playbooks define complete automation workflows with variables, conditionals, loops, and handlers.
PARAMETERS
-i inventory
Inventory file or path-e vars, --extra-vars vars
Extra variables (key=value or @file.yml)--tags tags
Run only tasks with these tags--skip-tags tags
Skip tasks with these tags--become
Run with privilege escalation-K, --ask-become-pass
Prompt for become password--check
Dry run without making changes--diff
Show differences in changed files-l hosts, --limit hosts
Limit to specific hosts--list-tasks
List tasks without executing--list-tags
List available tags-f forks, --forks forks
Parallel processes--start-at-task task
Start at specific task--step
Prompt before each task
CAVEATS
Playbook syntax errors fail fast; use --syntax-check first. Check mode may not work perfectly with all modules. Always test in non-production first.
HISTORY
ansible-playbook has been the primary execution method for Ansible automation since the project's creation in 2012, enabling infrastructure as code and declarative automation.
SEE ALSO
ansible(1), ansible-vault(1), ansible-lint(1)


