ansible.1.asciidoc.in 4.05 KB
Newer Older
1 2 3 4
ansible(1)
=========
:doctype:manpage
:man source:   Ansible
5
:man version:  %VERSION%
6 7 8 9 10 11 12 13 14
:man manual:   System administration commands

NAME
----
ansible - run a command somewhere else


SYNOPSIS
--------
15
ansible <host-pattern> [-f forks] [-m module_name] [-a args]
16 17 18 19 20


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

Michael DeHaan committed
21
*Ansible* is an extra-simple tool/framework/API for doing \'remote things' over
22 23 24
SSH.


25 26 27
ARGUMENTS
---------

28
*host-pattern*::
29

30 31 32
A name of a group in the inventory file, a shell-like glob selecting
hosts in inventory file, or any combination of the two separated by
semicolons.
33

34 35 36
OPTIONS
-------

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

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
The 'PATH' to the inventory hosts file, which defaults to '/etc/ansible/hosts'.
45 46


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

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

51 52 53 54
*--private-key=*'PRIVATE_KEY_FILE'::

Use this file to authenticate the connection.

55

56
*-m* 'NAME', *--module-name=*'NAME'::
57

58
Execute the module called 'NAME'.
59 60


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

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

67
*-a* \'_ARGUMENTS_', *--args=*\'_ARGUMENTS_'::
68

69
The 'ARGUMENTS' to pass to the module.
70

71
*-k*, *--ask-pass*::
72 73 74

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

75
*-K*, *--ask-sudo-pass*::
76 77

Prompt for the password to use with --sudo, if any
78

79
*-o*, *--one-line*::
80 81 82

Try to output everything on one line.

83
*-s*, *--sudo*::
84 85

Run the command as the user given by -u and sudo to root.
86

87
*-t* 'DIRECTORY', *--tree=*'DIRECTORY'::
88

89 90
Save contents in this output 'DIRECTORY', with the results saved in a
file named after each host.
91

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

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

96
*-B* 'NUM', *--background=*'NUM'::
97

98
Run commands in the background, killing the task after 'NUM' seconds.
99

100
*-P* 'NUM', *--poll=*'NUM'::
101

102
Poll a background job every 'NUM' seconds. Requires *-B*.
103

Ray committed
104
*-u* 'USERNAME', *--user=*'USERNAME'::
105

106
Use this remote 'USERNAME' instead of the current user.
107

108 109 110 111
*-U* 'SUDO_USERNAME', *--sudo-user=*'SUDO_USERNAME'::

Sudo to 'SUDO_USERNAME' instead of root.  Implies --sudo.

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

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

Michael DeHaan committed
117 118 119
*-l* 'SUBSET', *--limit=*'SUBSET'::

Further limits the selected host/group patterns.
120

121 122 123 124
*-l* '\~REGEX', *--limit=*'~REGEX'::

Further limits hosts with a regex pattern.

125 126 127 128
INVENTORY
---------

Ansible stores the hosts it can potentially operate on in an inventory
129
file. The syntax is one host per line.  Groups headers are allowed and
130 131 132 133
are included on their own line, enclosed in square brackets that
start the line.

Ranges of hosts are also supported.  For more information and
Maykel Moya committed
134
additional options, see the documentation on http://docs.ansible.com/.
135 136 137 138

FILES
-----

139
/etc/ansible/hosts -- Default inventory file
140

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

143
/etc/ansible/ansible.cfg -- Config file, used if present
Michael DeHaan committed
144

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

147 148 149
ENVIRONMENT
-----------

150
The following environment variables may be specified.
151 152 153 154 155

ANSIBLE_HOSTS  -- Override the default ansible hosts file

ANSIBLE_LIBRARY -- Override the default ansible module library path

156 157
ANSIBLE_CONFIG -- Override the default ansible config file

158

159 160 161 162 163 164 165 166 167 168 169 170
AUTHOR
------

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


COPYRIGHT
---------

Copyright © 2012, Michael DeHaan

171
Ansible is released under the terms of the GPLv3 License.
172 173 174 175 176


SEE ALSO
--------

177
*ansible-playbook*(1), *ansible-pull*(1), *ansible-doc*(1)
178

179 180 181
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>