1ANSIBLE-PLAYBOOK(1) System administration commands ANSIBLE-PLAYBOOK(1)
2
3
4
6 ansible-playbook - Runs Ansible playbooks, executing the defined tasks
7 on the targeted hosts.
8
10 usage: ansible-playbook [-h] [--version] [-v] [--private-key PRI‐
11 VATE_KEY_FILE]
12 [-u REMOTE_USER] [-c CONNECTION] [-T TIMEOUT] [--ssh-common-args
13 SSH_COMMON_ARGS] [--sftp-extra-args SFTP_EXTRA_ARGS] [--scp-ex‐
14 tra-args SCP_EXTRA_ARGS] [--ssh-extra-args SSH_EXTRA_ARGS] [-k |
15 --connection-password-file CONNECTION_PASSWORD_FILE]
16 [--force-handlers] [--flush-cache] [-b] [--become-method BE‐
17 COME_METHOD] [--become-user BECOME_USER] [-K | --become-pass‐
18 word-file BECOME_PASSWORD_FILE] [-t TAGS] [--skip-tags
19 SKIP_TAGS] [-C] [--syntax-check] [-D] [-i INVENTORY]
20 [--list-hosts] [-l SUBSET] [-e EXTRA_VARS] [--vault-id
21 VAULT_IDS] [--ask-vault-password | --vault-password-file
22 VAULT_PASSWORD_FILES] [-f FORKS] [-M MODULE_PATH] [--list-tasks]
23 [--list-tags] [--step] [--start-at-task START_AT_TASK] playbook
24 [playbook ...]
25
27 the tool to run Ansible playbooks, which are a configuration and
28 multinode deployment system. See the project home page (‐
29 https://docs.ansible.com) for more information.
30
32 Playbook(s)
33
34 --ask-vault-password, --ask-vault-pass
35 ask for vault password
36
37 --become-method 'BECOME_METHOD'
38 privilege escalation method to use (default=sudo), use ansible-doc
39 -t become -l to list valid choices.
40
41 --become-password-file 'BECOME_PASSWORD_FILE', --become-pass-file 'BE‐
42 COME_PASSWORD_FILE'
43 Become password file
44
45 --become-user 'BECOME_USER'
46 run operations as this user (default=root)
47
48 --connection-password-file 'CONNECTION_PASSWORD_FILE', --conn-pass-file
49 'CONNECTION_PASSWORD_FILE'
50 Connection password file
51
52 --flush-cache
53 clear the fact cache for every host in inventory
54
55 --force-handlers
56 run handlers even if a task fails
57
58 --list-hosts
59 outputs a list of matching hosts; does not execute anything else
60
61 --list-tags
62 list all available tags
63
64 --list-tasks
65 list all tasks that would be executed
66
67 --private-key 'PRIVATE_KEY_FILE', --key-file 'PRIVATE_KEY_FILE'
68 use this file to authenticate the connection
69
70 --scp-extra-args 'SCP_EXTRA_ARGS'
71 specify extra arguments to pass to scp only (e.g. -l)
72
73 --sftp-extra-args 'SFTP_EXTRA_ARGS'
74 specify extra arguments to pass to sftp only (e.g. -f, -l)
75
76 --skip-tags
77 only run plays and tasks whose tags do not match these values
78
79 --ssh-common-args 'SSH_COMMON_ARGS'
80 specify common arguments to pass to sftp/scp/ssh (e.g. ProxyCommand)
81
82 --ssh-extra-args 'SSH_EXTRA_ARGS'
83 specify extra arguments to pass to ssh only (e.g. -R)
84
85 --start-at-task 'START_AT_TASK'
86 start the playbook at the task matching this name
87
88 --step
89 one-step-at-a-time: confirm each task before running
90
91 --syntax-check
92 perform a syntax check on the playbook, but do not execute it
93
94 --vault-id
95 the vault identity to use
96
97 --vault-password-file, --vault-pass-file
98 vault password file
99
100 --version
101 show program's version number, config file location, configured mod‐
102 ule search path, module location, executable location and exit
103
104 -C, --check
105 don't make any changes; instead, try to predict some of the changes
106 that may occur
107
108 -D, --diff
109 when changing (small) files and templates, show the differences in
110 those files; works great with --check
111
112 -K, --ask-become-pass
113 ask for privilege escalation password
114
115 -M, --module-path
116 prepend colon-separated path(s) to module library (default=~/.ansi‐
117 ble/plugins/modules:/usr/share/ansible/plugins/modules)
118
119 -T 'TIMEOUT', --timeout 'TIMEOUT'
120 override the connection timeout in seconds (default=10)
121
122 -b, --become
123 run operations with become (does not imply password prompting)
124
125 -c 'CONNECTION', --connection 'CONNECTION'
126 connection type to use (default=smart)
127
128 -e, --extra-vars
129 set additional variables as key=value or YAML/JSON, if filename
130 prepend with @
131
132 -f 'FORKS', --forks 'FORKS'
133 specify number of parallel processes to use (default=5)
134
135 -h, --help
136 show this help message and exit
137
138 -i, --inventory, --inventory-file
139 specify inventory host path or comma separated host list. --inven‐
140 tory-file is deprecated
141
142 -k, --ask-pass
143 ask for connection password
144
145 -l 'SUBSET', --limit 'SUBSET'
146 further limit selected hosts to an additional pattern
147
148 -t, --tags
149 only run plays and tasks tagged with these values
150
151 -u 'REMOTE_USER', --user 'REMOTE_USER'
152 connect as this user (default=None)
153
154 -v, --verbose
155 verbose mode (-vvv for more, -vvvv to enable connection debugging)
156
158 The following environment variables may be specified.
159
160 ANSIBLE_CONFIG -- Specify override location for the ansible config file
161
162 Many more are available for most options in ansible.cfg
163
164 For a full list check https://docs.ansible.com/. or use the ansi‐
165 ble-config command.
166
168 /etc/ansible/ansible.cfg -- Config file, used if present
169
170 ~/.ansible.cfg -- User config file, overrides the default config if
171 present
172
173 ./ansible.cfg -- Local config file (in current working directory) as‐
174 sumed to be 'project specific' and overrides the rest if present.
175
176 As mentioned above, the ANSIBLE_CONFIG environment variable will over‐
177 ride all others.
178
180 Ansible was originally written by Michael DeHaan.
181
183 Copyright © 2018 Red Hat, Inc | Ansible. Ansible is released under the
184 terms of the GPLv3 license.
185
187 ansible [22m(1), ansible-config (1), ansible-console (1), ansible-doc (1),
188 ansible-galaxy (1), ansible-inventory [22m(1), ansible-pull [22m(1), ansi‐
189 ble-vault (1)
190
191 Extensive documentation is available in the documentation site: <‐
192 https://docs.ansible.com>. IRC and mailing list info can be found in
193 file CONTRIBUTING.md, available in: <‐
194 https://github.com/ansible/ansible>
195
196
197
198
199Ansible 2.12.7 ANSIBLE-PLAYBOOK(1)