ansible-playbook.1.asciidoc.in 3.9 KB
Newer Older
1 2 3 4
ansible-playbook(1)
===================
:doctype:manpage
:man source:   Ansible
5
:man version:  %VERSION%
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
:man manual:   System administration commands

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


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


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

21 22 23
*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.
24 25 26 27 28 29 30 31 32 33 34 35 36


ARGUMENTS
---------

*filename.yml*::

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


OPTIONS
-------

37
*-v*, *--verbose*::
38

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

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

44 45
The 'PATH' to the inventory hosts file, which defaults to
'/etc/ansible/hosts'.
46 47


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

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

54 55
*-e* 'VARS', *--extra-vars=*'VARS'::

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

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

62
Level of parallelism. 'NUM' is specified as an integer, the default is 5.
63 64 65 66


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

67 68
Prompt for the SSH password instead of assuming key-based
authentication with ssh-agent.
69 70


71 72
*-K*, *--ask-sudo-pass*::

73 74
Prompt for the password to use for playbook plays that request sudo
access, if any.
75

76 77 78
*-U*, 'SUDO_USER', *--sudo-user=*'SUDO_USER'::

Desired sudo user (default=root).
79

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

82 83
Only run plays and tasks tagged with these values.

84
*--skip-tags=*'SKIP_TAGS'::
85 86

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

88
*--syntax-check*::
89 90 91 92 93 94 95 96 97 98 99 100 101 102

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

*--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.

*--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.

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

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


108
*-s*, *--sudo*::
109 110 111 112

Force all plays to use sudo, even if not marked as such.


Ray committed
113
*-u* 'USERNAME', *--user=*'USERNAME'::
114

115 116 117 118 119 120 121 122
Use this remote user name on playbook steps that do not indicate a
user name to run as.

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

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

Michael DeHaan committed
123 124 125
*-l* 'SUBSET', *--limit=*'SUBSET'::

Further limits the selected host/group patterns.
126

127 128 129
*--list-hosts*::

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

131 132 133
ENVIRONMENT
-----------

134
The following environment variables may be specified.
135

Till Maas committed
136
ANSIBLE_INVENTORY  -- Override the default ansible inventory file
137 138 139

ANSIBLE_LIBRARY -- Override the default ansible module library path

Michael DeHaan committed
140 141 142 143 144 145 146
FILES
-----

/etc/ansible/hosts -- Default inventory file

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

147
/etc/ansible/ansible.cfg -- Config file, used if present
Michael DeHaan committed
148

149
~/.ansible.cfg -- User config file, overrides the default config if present
150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168

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
--------

169
*ansible*(1), *ansible-pull*(1), *ansible-doc*(1)
170

171 172 173
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>