summaryrefslogtreecommitdiffstats
path: root/docs/man/man1/ansible-playbook.1.asciidoc.in
blob: 3360c0d454a979e03590ab32eb5ec6de17ab80de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
ansible-playbook(1)
===================
:doctype:      manpage
:man source:   Ansible
:man version:  %VERSION%
:man manual:   System administration commands

NAME
----
ansible-playbook - run an ansible playbook


SYNOPSIS
--------
ansible-playbook <filename.yml> ... [options]


DESCRIPTION
-----------

*Ansible playbooks* are a configuration and multinode deployment
system.  Ansible-playbook is the tool used to run them.  See the
project home page (link below) for more information.


ARGUMENTS
---------

*filename.yml*::

The names of one or more YAML format files to run as ansible playbooks.


OPTIONS
-------

*-b*, *--become*::

Use privilege escalation (specific one depends on become_method),
this does not imply prompting for passwords.

*-K*, *--ask-become-pass*::

Ask for privilege escalation password.

*-k*, *--ask-pass*::

Prompt for the connection password, if it is needed for the transport used.
For example, using ssh and not having a key-based authentication with ssh-agent.

*--ask-su-pass*::

Prompt for su password, used with --su (deprecated, use become).

*--ask-sudo-pass*::

Prompt for the password to use with --sudo, if any (deprecated, use become).

*--ask-vault-pass*::

Prompt for vault password.

*-C*, *--check*::

Do not make any changes on the remote system, but test resources to see what might
have changed.  Note this can not scan all possible resource types and is only
a simulation.

*-c* 'CONNECTION', *--connection=*'CONNECTION'::

Connection type to use.  Most common options are 'paramiko' (SSH), 'ssh', 'winrm'
and 'local'.  'local' is mostly useful for crontab or kickstarts.

*-D*, *--diff*::

When changing any templated files, show the unified diffs of how they changed.  When
used with --check, shows how the files would have changed if --check were not used.

*-e* 'EXTRA_VARS', *--extra-vars=*'EXTRA_VARS'::

Extra variables to inject into a playbook, in key=value key=value format or
as quoted YAML/JSON (hashes and arrays). To load variables from a file, specify
the file preceded by @ (e.g. @vars.yml).

*--flush-cache*::

Clear the fact cache.

*--force-handlers*::

Run handlers even if a task fails.

*-f* 'NUM', *--forks=*'NUM'::

Level of parallelism. 'NUM' is specified as an integer, the default is 5.

*-h*, *--help*::

Show help page and exit.

*-i* 'PATH', *--inventory=*'PATH'::

The 'PATH' to the inventory, which defaults to '/etc/ansible/hosts'.
Alternatively, you can use a comma-separated list of hosts or a single host with a trailing comma 'host,'.

*-l* 'SUBSET', *--limit=*'SUBSET'::

Further limits the selected host/group patterns.
You can prefix it with '~' to indicate that the pattern is a regex.

*--list-hosts*::

Outputs a list of matching hosts; does not execute anything else.

*--list-tags*::

List all available tags; does not execute anything else.

*--list-tasks*::

List all tasks that would be executed; does not execute anything else.

*-M* 'DIRECTORY', *--module-path=*'DIRECTORY'::

The 'DIRECTORY' search path to load modules from. The default is
'/usr/share/ansible'. This can also be set with the ANSIBLE_LIBRARY
environment variable.

*--private-key=*'PRIVATE_KEY_FILE'::

Use this file to authenticate the connection.

*--start-at-task=*'START_AT'::

Start the playbook at the task matching this name.

*--step*::

One-step-at-a-time: confirm each task before running.

*-S*, --su*::

Run operations with su (deprecated, use become).

*-R SU-USER*, *--su-user=*'SU_USER'::

Run operations with su as this user (default=root) (deprecated, use become).

*-s*, *--sudo*::

Run the command as the user given by -u and sudo to root (deprecated, use become).

*--ssh-common-args=*''-o ProxyCommand="ssh -W %h:%p ..." ...''::

Add the specified arguments to any sftp/scp/ssh command-line. Useful to
set a ProxyCommand to use a jump host, but any arguments that are
accepted by all three programs may be specified.

*--sftp-extra-args=*''-f ...''::

Add the specified arguments to any sftp command-line.

*--scp-extra-args=*''-l ...''::

Add the specified arguments to any scp command-line.

*--ssh-extra-args=*''-R ...''::

Add the specified arguments to any ssh command-line.

*-U* 'SUDO_USERNAME', *--sudo-user=*'SUDO_USERNAME'::

Sudo to 'SUDO_USERNAME' default is root. (deprecated, use become).

*--skip-tags=*'SKIP_TAGS'::

Only run plays and tasks whose tags do not match these values.

*--syntax-check*::

Look for syntax errors in the playbook, but don't run anything.

*-t*, 'TAGS', *--tags=*'TAGS'::

Only run plays and tasks tagged with these values.

*-T* 'SECONDS', *--timeout=*'SECONDS'::

Connection timeout to use when trying to talk to hosts, in 'SECONDS'.

*-u* 'USERNAME', *--user=*'USERNAME'::

Use this 'USERNAME' to login to the target host, instead of the current user.

*--vault-password-file=*'VAULT_PASSWORD_FILE'::

Vault password file.

*-v*, *--verbose*::

Verbose mode, more output from successful actions will be shown. Give
up to three times for more output.

*--version*::

Show program's version number and exit.

EXIT STATUS
-----------

*0* -- OK or no hosts matched

*1* -- Error

*2* -- One or more hosts failed

*3* -- One or more hosts were unreachable

*4* -- Parser error

*5* -- Bad or incomplete options

*99* -- User interrupted execution

*250* -- Unexpected error

ENVIRONMENT
-----------

The following environment variables may be specified:

ANSIBLE_INVENTORY  -- Override the default ansible inventory file

ANSIBLE_LIBRARY -- Override the default ansible module library path

ANSIBLE_CONFIG -- Override the default ansible config file

Many more are available for most options in ansible.cfg


FILES
-----

/etc/ansible/hosts -- Default inventory file

/usr/share/ansible/ -- Default module library

/etc/ansible/ansible.cfg -- Config file, used if present

~/.ansible.cfg -- User config file, overrides the default config if present


AUTHOR
------

Ansible was originally written by Michael DeHaan. See the AUTHORS file
for a complete list of contributors.


COPYRIGHT
---------

Copyright © 2012, Michael DeHaan

Ansible is released under the terms of the GPLv3 License.


SEE ALSO
--------

*ansible*(1), *ansible-pull*(1), *ansible-doc*(1), *ansible-vault*(1), *ansible-galaxy*(1)

Extensive documentation is available in the documentation site:
<http://docs.ansible.com>. IRC and mailing list info can be found
in file CONTRIBUTING.md, available in: <https://github.com/ansible/ansible>