ansible-playbook(1)
โจ ansible-playbook โ the main character of the ansible fam โจ
okay so bestie, welcome to ansible-playbook(1), part of the system administration commands squad. This is the tool that runs Ansible playbooks โ and a playbook is basically a configuration + multinode deployment system, like a vibe board that actually executes. Want more deets? The project home page is right here: <https://docs.ansible.com>. iykyk ๐
๐ SYNOPSIS ๐
usage: ansible-playbook [-h] [--version] [-v] [--private-key
PRIVATE_KEY_FILE]
[-u REMOTE_USER] [-c CONNECTION] [-T TIMEOUT] [--ssh-common-args
SSH_COMMON_ARGS] [--sftp-extra-args SFTP_EXTRA_ARGS]
[--scp-extra-args SCP_EXTRA_ARGS] [--ssh-extra-args
SSH_EXTRA_ARGS] [-k | --connection-password-file
CONNECTION_PASSWORD_FILE] [--force-handlers] [-b]
[--become-method BECOME_METHOD] [--become-user BECOME_USER] [-K |
--become-password-file BECOME_PASSWORD_FILE] [-t TAGS]
[--skip-tags SKIP_TAGS] [-C] [-D] [-i INVENTORY] [--list-hosts]
[-l SUBSET] [--flush-cache] [-e EXTRA_VARS] [--vault-id
VAULT_IDS] [-J | --vault-password-file VAULT_PASSWORD_FILES] [-f
FORKS] [-M MODULE_PATH] [--syntax-check] [--list-tasks]
[--list-tags] [--step] [--start-at-task START_AT_TASK] playbook
[playbook ...]
๐ DESCRIPTION ๐
so this is the tool to run Ansible playbooks, which are a configuration and multinode deployment system. literally the whole point. for more info, the project home page is at <https://docs.ansible.com> โ go be nosy ๐ฆ
๐ COMMON OPTIONS ๐
Playbook(s)โ the playbook file(s) you're feeding it, bestie. that's the whole assignment ๐ซถ--become-method 'BECOME_METHOD'โ which privilege escalation method to use (default=sudo). wanna see the valid choices? runansible-doc -t become -land it'll show you the menu โจ--become-password-file 'BECOME_PASSWORD_FILE',--become-pass-file 'BECOME_PASSWORD_FILE'โ become password file ๐--become-user 'BECOME_USER'โ run operations as this user (default=root) ๐--connection-password-file 'CONNECTION_PASSWORD_FILE',--conn-pass-file 'CONNECTION_PASSWORD_FILE'โ connection password file ๐--flush-cacheโ clear the fact cache for every host in inventory ๐งน--force-handlersโ run handlers even if a task fails. no skipping, periodt ๐--list-hostsโ outputs a list of matching hosts; does not execute anything else. just a lil peek ๐--list-tagsโ list all available tags ๐ท๏ธ--list-tasksโ list all tasks that would be executed ๐--private-key 'PRIVATE_KEY_FILE',--key-file 'PRIVATE_KEY_FILE'โ use this file to authenticate the connection ๐๏ธ--scp-extra-args 'SCP_EXTRA_ARGS'โ specify extra arguments to pass toscponly (e.g.-l) ๐ฆ--sftp-extra-args 'SFTP_EXTRA_ARGS'โ specify extra arguments to pass tosftponly (e.g.-f,-l) ๐--skip-tagsโ only run plays and tasks whose tags do not match these values. this argument may be specified multiple times ๐ โโ๏ธ--ssh-common-args 'SSH_COMMON_ARGS'โ specify common arguments to pass tosftp/scp/ssh(e.g.ProxyCommand) ๐--ssh-extra-args 'SSH_EXTRA_ARGS'โ specify extra arguments to pass tosshonly (e.g.-R) ๐ฐ๏ธ--start-at-task 'START_AT_TASK'โ start the playbook at the task matching this name โฉ--stepโ one-step-at-a-time: confirm each task before running. very "are you sure bestie" energy ๐--syntax-checkโ perform a syntax check on the playbook, but do not execute it. read-only queen ๐--vault-idโ the vault identity to use. this argument may be specified multiple times ๐ฎ--vault-password-file,--vault-pass-fileโ vault password file ๐คซ--versionโ show program's version number, config file location, configured module search path, module location, executable location and exit. the full rรฉsumรฉ, then bounce ๐จ-C,--checkโ don't make any changes; instead, try to predict some of the changes that may occur ๐-D,--diffโ when changing (small) files and templates, show the differences in those files; works great with--check. the before/after glow-up reveal โจ-J,--ask-vault-password,--ask-vault-passโ ask for vault password ๐โโ๏ธ-K,--ask-become-passโ ask for privilege escalation password ๐-M,--module-pathโ prepend colon-separated path(s) to module library (default={{ ANSIBLE_HOME ~ "/plugins/modules:/usr/share/ansible/plugins/modules" }}). this argument may be specified multiple times ๐๏ธ-T 'TIMEOUT',--timeout 'TIMEOUT'โ override the connection timeout in seconds (default depends on connection) โฑ๏ธ-b,--becomeโ run operations with become (does not imply password prompting) ๐ช-c 'CONNECTION',--connection 'CONNECTION'โ connection type to use (default=ssh) ๐-e,--extra-varsโ set additional variables askey=valueor YAML/JSON, if filename prepend with@. this argument may be specified multiple times ๐-f 'FORKS',--forks 'FORKS'โ specify number of parallel processes to use (default=5) ๐ด-h,--helpโ show this help message and exit ๐-i,--inventory,--inventory-fileโ specify inventory host path or comma separated host list. this argument may be specified multiple times ๐-k,--ask-passโ ask for connection password ๐-l 'SUBSET',--limit 'SUBSET'โ further limit selected hosts to an additional pattern ๐ฏ-t,--tagsโ only run plays and tasks tagged with these values. this argument may be specified multiple times ๐ท๏ธ-u 'REMOTE_USER',--user 'REMOTE_USER'โ connect as this user (default=None) ๐ค-v,--verboseโ causes Ansible to print more debug messages. adding multiple-vwill increase the verbosity, the builtin plugins currently evaluate up to-vvvvvv. a reasonable level to start is-vvv, connection debugging might require-vvvv. this argument may be specified multiple times ๐ฃ๏ธ
๐ฆ INVENTORY ๐ฆ
Ansible stores the hosts it can potentially operate on in an inventory. this can be a YAML file, ini-like file, a script, directory, list, etc. โ honestly whatever shape your chaos takes. for additional options, see the documentation on <https://docs.ansible.com/> ๐
๐ธ ENVIRONMENT ๐ธ
the following environment variables may be specified:
ANSIBLE_INVENTORYโ override the default ansible inventory sourcesANSIBLE_LIBRARYโ override the default ansible module library pathANSIBLE_CONFIGโ specify override location for the ansible config file
many more are available for most options in ansible.cfg ๐ซ
for a full list check <https://docs.ansible.com/>. or use the ansible-config command ๐
๐ FILES ๐
/etc/ansible/hostsโ default inventory file/etc/ansible/ansible.cfgโ config file, used if present~/.ansible.cfgโ user config file, overrides the default config if present./ansible.cfgโ local config file (in current working directory) assumed to be 'project specific' and overrides the rest if present.
as mentioned above, the ANSIBLE_CONFIG environment variable will override all others. it's giving final boss energy ๐๐ฅ
๐ AUTHOR ๐
Ansible was originally written by Michael DeHaan. legend behaviour, fr fr ๐ซถ
๐ COPYRIGHT ๐
Copyright ยฉ 2018 Red Hat, Inc | Ansible. Ansible is released under the terms of the GPLv3 license ๐
โญ SEE ALSO โญ
ansible(1)ansible-config(1)ansible-console(1)ansible-doc(1)ansible-galaxy(1)ansible-inventory(1)ansible-pull(1)ansible-vault(1)
extensive documentation is available in the documentation site: <<https://docs.ansible.com>>. IRC and mailing list info can be found in file CONTRIBUTING.md, available in: <<https://github.com/ansible/ansible>> ๐
and that's the whole page bestie ๐
this icon was brought to you by Ansible 2.22.0, living under the name ansible-playbook(1) โ go run some playbooks, slay, and remember: check mode first ๐โจ
๐ฆ where this page comes from
- arch rolling: ansible-core 2.22.0-1 ยท GPL-3.0-or-later AND BSD-2-Clause AND PSF-2.0 AND MIT AND Apache-2.0
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms