ansible.1 7.31 KB
Newer Older
1 2
'\" t
.\"     Title: ansible
3
.\"    Author: :doctype:manpage
4
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
snetting committed
5
.\"      Date: 07/15/2015
6
.\"    Manual: System administration commands
snetting committed
7
.\"    Source: Ansible %VERSION%
8 9
.\"  Language: English
.\"
snetting committed
10
.TH "ANSIBLE" "1" "07/15/2015" "Ansible %VERSION%" "System administration commands"
11 12 13 14 15 16 17 18 19
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
ansible \- run a command somewhere else
.SH "SYNOPSIS"
.sp
ansible <host\-pattern> [\-f forks] [\-m module_name] [\-a args]
.SH "DESCRIPTION"
.sp
37
\fBAnsible\fR is an extra\-simple tool/framework/API for doing \*(Aqremote things\*(Aq over SSH\&.
38 39 40 41
.SH "ARGUMENTS"
.PP
\fBhost\-pattern\fR
.RS 4
42
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\&.
43 44 45
.RE
.SH "OPTIONS"
.PP
snetting committed
46
\fB\-a\fR \*(Aq\fIARGUMENTS\fR\*(Aq, \fB\-\-args=\fR\*(Aq\fIARGUMENTS\fR\*(Aq
47
.RS 4
snetting committed
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
The
\fIARGUMENTS\fR
to pass to the module\&.
.RE
.PP
\fB\-\-ask\-become\-pass\fR
.RS 4
Ask for privilege escalation password\&.
.RE
.PP
\fB\-k\fR, \fB\-\-ask\-pass\fR
.RS 4
Prompt for the SSH password instead of assuming key\-based authentication with ssh\-agent\&.
.RE
.PP
\fB\-\-ask\-su\-pass\fR
.RS 4
Prompt for su password (deprecated, use become)\&.
.RE
.PP
\fB\-K\fR, \fB\-\-ask\-sudo\-pass\fR
.RS 4
Prompt for the password to use with \-\-sudo, if any\&.
.RE
.PP
\fB\-\-ask\-vault\-pass\fR
.RS 4
Prompt for vault password\&.
.RE
.PP
\fB\-B\fR \fINUM\fR, \fB\-\-background=\fR\fINUM\fR
.RS 4
Run commands in the background, killing the task after
\fINUM\fR
seconds\&.
.RE
.PP
\fB\-\-become\-method=\fR\fIBECOME_METHOD\fR
.RS 4
87
Privilege escalation method to use (default=sudo), valid choices: [ sudo | su | pbrun | pfexec | runas | doas ]
snetting committed
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
.RE
.PP
\fB\-\-become\-user=\fR\fIBECOME_USER\fR
.RS 4
Run operations as this user (default=None)\&.
.RE
.PP
\fB\-C\fR, \fB\-\-check\fR
.RS 4
Don\(cqt make any changes; instead try to predict some of the changes that may occur\&.
.RE
.PP
\fB\-c\fR \fICONNECTION\fR, \fB\-\-connection=\fR\fICONNECTION\fR
.RS 4
Connection type to use\&. Possible options are
\fIparamiko\fR
(SSH),
\fIssh\fR, and
\fIlocal\fR\&.
\fIlocal\fR
is mostly useful for crontab or kickstarts\&.
.RE
.PP
\fB\-e\fR \fIEXTRA_VARS*, \fR\fI\fB\-\-extra\-vars=\fR\fR\fI\*(AqEXTRA_VARS\fR
.RS 4
Set additional variables as key=value or YAML/JSON\&.
.RE
.PP
\fB\-f\fR \fINUM\fR, \fB\-\-forks=\fR\fINUM\fR
.RS 4
Level of parallelism\&.
\fINUM\fR
is specified as an integer, the default is 5\&.
.RE
.PP
\fB\-h\fR, \fB\-\-help\fR
.RS 4
Show help message and exit\&.
126 127
.RE
.PP
128
\fB\-i\fR \fIPATH\fR, \fB\-\-inventory=\fR\fIPATH\fR
129
.RS 4
130 131 132 133
The
\fIPATH\fR
to the inventory hosts file, which defaults to
\fI/etc/ansible/hosts\fR\&.
134 135
.RE
.PP
snetting committed
136
\fB\-l\fR \fISUBSET\fR, \fB\-\-limit=\fR\fISUBSET\fR
137
.RS 4
snetting committed
138
Further limits the selected host/group patterns\&.
139 140
.RE
.PP
snetting committed
141
\fB\-l\fR \fI~REGEX\fR, \fB\-\-limit=\fR\fI~REGEX\fR
Tim Bielawa committed
142
.RS 4
snetting committed
143 144 145 146 147 148
Further limits hosts with a regex pattern\&.
.RE
.PP
\fB\-\-list\-hosts\fR
.RS 4
Outputs a list of matching hosts; does not execute anything else\&.
Tim Bielawa committed
149 150
.RE
.PP
151
\fB\-m\fR \fINAME\fR, \fB\-\-module\-name=\fR\fINAME\fR
152
.RS 4
153 154
Execute the module called
\fINAME\fR\&.
155 156
.RE
.PP
157
\fB\-M\fR \fIDIRECTORY\fR, \fB\-\-module\-path=\fR\fIDIRECTORY\fR
158
.RS 4
159 160
The
\fIDIRECTORY\fR
161 162
search path to load modules from\&. The default is
\fI/usr/share/ansible\fR\&. This can also be set with the ANSIBLE_LIBRARY environment variable\&.
163 164
.RE
.PP
snetting committed
165
\fB\-o\fR, \fB\-\-one\-line\fR
166
.RS 4
snetting committed
167
Try to output everything on one line\&.
168
.RE
169
.PP
snetting committed
170
\fB\-P\fR \fINUM\fR, \fB\-\-poll=\fR\fINUM\fR
171
.RS 4
snetting committed
172 173 174 175
Poll a background job every
\fINUM\fR
seconds\&. Requires
\fB\-B\fR\&.
176 177
.RE
.PP
snetting committed
178
\fB\-\-private\-key=\fR\fIPRIVATE_KEY_FILE\fR
179
.RS 4
snetting committed
180
Use this file to authenticate the connection\&.
181 182
.RE
.PP
snetting committed
183
\fB\-S\fR, \fB\-\-su\fR
184
.RS 4
snetting committed
185 186 187 188 189 190
Run operations with su (deprecated, use become)\&.
.RE
.PP
\fB\-R\fR \fISU_USER\fR, \fB\-\-se\-user=\fR\fISUDO_USER\fR
.RS 4
Run operations with su as this user (default=root) (deprecated, use become)
191 192
.RE
.PP
Michael DeHaan committed
193
\fB\-s\fR, \fB\-\-sudo\fR
194
.RS 4
Till Maas committed
195
Run the command as the user given by \-u and sudo to root\&.
196 197
.RE
.PP
snetting committed
198 199 200 201 202 203 204
\fB\-U\fR \fISUDO_USERNAME\fR, \fB\-\-sudo\-user=\fR\fISUDO_USERNAME\fR
.RS 4
Sudo to
\fISUDO_USERNAME\fR
instead of root\&. Implies \-\-sudo\&.
.RE
.PP
205
\fB\-t\fR \fIDIRECTORY\fR, \fB\-\-tree=\fR\fIDIRECTORY\fR
206 207 208 209 210
.RS 4
Save contents in this output
\fIDIRECTORY\fR, with the results saved in a file named after each host\&.
.RE
.PP
211
\fB\-T\fR \fISECONDS\fR, \fB\-\-timeout=\fR\fISECONDS\fR
212 213 214 215 216
.RS 4
Connection timeout to use when trying to talk to hosts, in
\fISECONDS\fR\&.
.RE
.PP
217
\fB\-u\fR \fIUSERNAME\fR, \fB\-\-user=\fR\fIUSERNAME\fR
218 219 220
.RS 4
Use this remote
\fIUSERNAME\fR
221
instead of the current user\&.
222 223
.RE
.PP
snetting committed
224
\fB\-\-vault\-password\-file=\fR\fIVAULT_PASSWORD_FILE\fR
225
.RS 4
snetting committed
226
Vault password file\&.
227 228
.RE
.PP
snetting committed
229
\fB\-v\fR, \fB\-\-verbose\fR
230
.RS 4
snetting committed
231
Verbose mode, more output from successful actions will be shown\&. Give up to three times for more output\&.
232
.RE
233
.PP
snetting committed
234
\fB\-\-version\fR
235
.RS 4
snetting committed
236
Show program version number and exit\&.
237
.RE
238 239
.SH "INVENTORY"
.sp
240 241
Ansible stores the hosts it can potentially operate on in an inventory file\&. The syntax is one host per line\&. Groups headers are allowed and are included on their own line, enclosed in square brackets that start the line\&.
.sp
242
Ranges of hosts are also supported\&. For more information and additional options, see the documentation on http://docs\&.ansible\&.com/\&.
243 244 245 246 247
.SH "FILES"
.sp
/etc/ansible/hosts \(em Default inventory file
.sp
/usr/share/ansible/ \(em Default module library
248
.sp
249
/etc/ansible/ansible\&.cfg \(em Config file, used if present
250
.sp
251
~/\&.ansible\&.cfg \(em User config file, overrides the default config if present
252 253
.SH "ENVIRONMENT"
.sp
254
The following environment variables may be specified\&.
255
.sp
Till Maas committed
256
ANSIBLE_INVENTORY  \(em Override the default ansible inventory file
257 258
.sp
ANSIBLE_LIBRARY \(em Override the default ansible module library path
259 260
.sp
ANSIBLE_CONFIG \(em Override the default ansible config file
261 262 263 264 265 266 267 268 269 270
.SH "AUTHOR"
.sp
Ansible was originally written by Michael DeHaan\&. See the AUTHORS file for a complete list of contributors\&.
.SH "COPYRIGHT"
.sp
Copyright \(co 2012, Michael DeHaan
.sp
Ansible is released under the terms of the GPLv3 License\&.
.SH "SEE ALSO"
.sp
Michael DeHaan committed
271
\fBansible\-playbook\fR(1), \fBansible\-pull\fR(1), \fBansible\-doc\fR(1)
272
.sp
273
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
Till Maas committed
274 275 276 277 278 279
.SH "AUTHOR"
.PP
\fB:doctype:manpage\fR
.RS 4
Author.
.RE