summaryrefslogtreecommitdiffstats
path: root/docs/man/man1/ansible-pull.1
blob: 2fe0c038a01751520c5a435f961d44aa67534282 (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
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
.\" Man page generated from reStructuredText.
.
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "ANSIBLE-PULL" 1 "" "Ansible 2.14.3" "System administration commands"
.SH NAME
ansible-pull \- pulls playbooks from a VCS repo and executes them for the local host
.SH SYNOPSIS
.INDENT 0.0
.TP
.B usage: ansible\-pull [\-h] [\-\-version] [\-v] [\-\-private\-key PRIVATE_KEY_FILE]
[\-u REMOTE_USER] [\-c CONNECTION] [\-T TIMEOUT]
[\-\-ssh\-common\-args SSH_COMMON_ARGS]
[\-\-sftp\-extra\-args SFTP_EXTRA_ARGS]
[\-\-scp\-extra\-args SCP_EXTRA_ARGS]
[\-\-ssh\-extra\-args SSH_EXTRA_ARGS]
[\-k | \-\-connection\-password\-file CONNECTION_PASSWORD_FILE]
[\-\-vault\-id VAULT_IDS]
[\-\-ask\-vault\-password | \-\-vault\-password\-file VAULT_PASSWORD_FILES]
[\-e EXTRA_VARS] [\-t TAGS] [\-\-skip\-tags SKIP_TAGS]
[\-i INVENTORY] [\-\-list\-hosts] [\-l SUBSET] [\-M MODULE_PATH]
[\-K | \-\-become\-password\-file BECOME_PASSWORD_FILE]
[\-\-purge] [\-o] [\-s SLEEP] [\-f] [\-d DEST] [\-U URL] [\-\-full]
[\-C CHECKOUT] [\-\-accept\-host\-key] [\-m MODULE_NAME]
[\-\-verify\-commit] [\-\-clean] [\-\-track\-subs] [\-\-check]
[\-\-diff]
[playbook.yml ...]
.UNINDENT
.SH DESCRIPTION
.sp
Used to pull a remote copy of ansible on each managed node,
each set to run via cron and update playbook source via a source repository.
This inverts the default \fIpush\fP architecture of ansible into a \fIpull\fP
architecture,
which has near\-limitless scaling potential.
.sp
None of the CLI tools are designed to run concurrently with themselves,
you should use an external scheduler and/or locking to ensure there are no
clashing operations.
.sp
The setup playbook can be tuned to change the cron frequency, logging
locations, and parameters to ansible\-pull.
This is useful both for extreme scale\-out as well as periodic remediation.
Usage of the \(aqfetch\(aq module to retrieve logs from ansible\-pull runs would be an
excellent way to gather and analyze remote logs from ansible\-pull.
.SH COMMON OPTIONS
.INDENT 0.0
.INDENT 3.5
Playbook(s)
.UNINDENT
.UNINDENT
.sp
\fB\-\-accept\-host\-key\fP
.INDENT 0.0
.INDENT 3.5
adds the hostkey for the repo url if not already added
.UNINDENT
.UNINDENT
.sp
\fB\-\-ask\-vault\-password\fP, \fB\-\-ask\-vault\-pass\fP
.INDENT 0.0
.INDENT 3.5
ask for vault password
.UNINDENT
.UNINDENT
.sp
\fB\-\-become\-password\-file\fP \(aqBECOME_PASSWORD_FILE\(aq, \fB\-\-become\-pass\-file\fP \(aqBECOME_PASSWORD_FILE\(aq
.INDENT 0.0
.INDENT 3.5
Become password file
.UNINDENT
.UNINDENT
.sp
\fB\-\-check\fP
.INDENT 0.0
.INDENT 3.5
don\(aqt make any changes; instead, try to predict some of the changes that may occur
.UNINDENT
.UNINDENT
.sp
\fB\-\-clean\fP
.INDENT 0.0
.INDENT 3.5
modified files in the working repository will be discarded
.UNINDENT
.UNINDENT
.sp
\fB\-\-connection\-password\-file\fP \(aqCONNECTION_PASSWORD_FILE\(aq, \fB\-\-conn\-pass\-file\fP \(aqCONNECTION_PASSWORD_FILE\(aq
.INDENT 0.0
.INDENT 3.5
Connection password file
.UNINDENT
.UNINDENT
.sp
\fB\-\-diff\fP
.INDENT 0.0
.INDENT 3.5
when changing (small) files and templates, show the differences in those files; works great with \-\-check
.UNINDENT
.UNINDENT
.sp
\fB\-\-full\fP
.INDENT 0.0
.INDENT 3.5
Do a full clone, instead of a shallow one.
.UNINDENT
.UNINDENT
.sp
\fB\-\-list\-hosts\fP
.INDENT 0.0
.INDENT 3.5
outputs a list of matching hosts; does not execute anything else
.UNINDENT
.UNINDENT
.sp
\fB\-\-private\-key\fP \(aqPRIVATE_KEY_FILE\(aq, \fB\-\-key\-file\fP \(aqPRIVATE_KEY_FILE\(aq
.INDENT 0.0
.INDENT 3.5
use this file to authenticate the connection
.UNINDENT
.UNINDENT
.sp
\fB\-\-purge\fP
.INDENT 0.0
.INDENT 3.5
purge checkout after playbook run
.UNINDENT
.UNINDENT
.sp
\fB\-\-scp\-extra\-args\fP \(aqSCP_EXTRA_ARGS\(aq
.INDENT 0.0
.INDENT 3.5
specify extra arguments to pass to scp only (e.g. \-l)
.UNINDENT
.UNINDENT
.sp
\fB\-\-sftp\-extra\-args\fP \(aqSFTP_EXTRA_ARGS\(aq
.INDENT 0.0
.INDENT 3.5
specify extra arguments to pass to sftp only (e.g. \-f, \-l)
.UNINDENT
.UNINDENT
.sp
\fB\-\-skip\-tags\fP
.INDENT 0.0
.INDENT 3.5
only run plays and tasks whose tags do not match these values
.UNINDENT
.UNINDENT
.sp
\fB\-\-ssh\-common\-args\fP \(aqSSH_COMMON_ARGS\(aq
.INDENT 0.0
.INDENT 3.5
specify common arguments to pass to sftp/scp/ssh (e.g. ProxyCommand)
.UNINDENT
.UNINDENT
.sp
\fB\-\-ssh\-extra\-args\fP \(aqSSH_EXTRA_ARGS\(aq
.INDENT 0.0
.INDENT 3.5
specify extra arguments to pass to ssh only (e.g. \-R)
.UNINDENT
.UNINDENT
.sp
\fB\-\-track\-subs\fP
.INDENT 0.0
.INDENT 3.5
submodules will track the latest changes. This is equivalent to specifying the \-\-remote flag to git submodule update
.UNINDENT
.UNINDENT
.sp
\fB\-\-vault\-id\fP
.INDENT 0.0
.INDENT 3.5
the vault identity to use
.UNINDENT
.UNINDENT
.sp
\fB\-\-vault\-password\-file\fP, \fB\-\-vault\-pass\-file\fP
.INDENT 0.0
.INDENT 3.5
vault password file
.UNINDENT
.UNINDENT
.sp
\fB\-\-verify\-commit\fP
.INDENT 0.0
.INDENT 3.5
verify GPG signature of checked out commit, if it fails abort running the playbook. This needs the corresponding VCS module to support such an operation
.UNINDENT
.UNINDENT
.sp
\fB\-\-version\fP
.INDENT 0.0
.INDENT 3.5
show program\(aqs version number, config file location, configured module search path, module location, executable location and exit
.UNINDENT
.UNINDENT
.sp
\fB\-C\fP \(aqCHECKOUT\(aq, \fB\-\-checkout\fP \(aqCHECKOUT\(aq
.INDENT 0.0
.INDENT 3.5
branch/tag/commit to checkout. Defaults to behavior of repository module.
.UNINDENT
.UNINDENT
.sp
\fB\-K\fP, \fB\-\-ask\-become\-pass\fP
.INDENT 0.0
.INDENT 3.5
ask for privilege escalation password
.UNINDENT
.UNINDENT
.sp
\fB\-M\fP, \fB\-\-module\-path\fP
.INDENT 0.0
.INDENT 3.5
prepend colon\-separated path(s) to module library (default={{ ANSIBLE_HOME ~ \(dq/plugins/modules:/usr/share/ansible/plugins/modules\(dq }})
.UNINDENT
.UNINDENT
.sp
\fB\-T\fP \(aqTIMEOUT\(aq, \fB\-\-timeout\fP \(aqTIMEOUT\(aq
.INDENT 0.0
.INDENT 3.5
override the connection timeout in seconds (default=10)
.UNINDENT
.UNINDENT
.sp
\fB\-U\fP \(aqURL\(aq, \fB\-\-url\fP \(aqURL\(aq
.INDENT 0.0
.INDENT 3.5
URL of the playbook repository
.UNINDENT
.UNINDENT
.sp
\fB\-c\fP \(aqCONNECTION\(aq, \fB\-\-connection\fP \(aqCONNECTION\(aq
.INDENT 0.0
.INDENT 3.5
connection type to use (default=smart)
.UNINDENT
.UNINDENT
.sp
\fB\-d\fP \(aqDEST\(aq, \fB\-\-directory\fP \(aqDEST\(aq
.INDENT 0.0
.INDENT 3.5
absolute path of repository checkout directory (relative paths are not supported)
.UNINDENT
.UNINDENT
.sp
\fB\-e\fP, \fB\-\-extra\-vars\fP
.INDENT 0.0
.INDENT 3.5
set additional variables as key=value or YAML/JSON, if filename prepend with @
.UNINDENT
.UNINDENT
.sp
\fB\-f\fP, \fB\-\-force\fP
.INDENT 0.0
.INDENT 3.5
run the playbook even if the repository could not be updated
.UNINDENT
.UNINDENT
.sp
\fB\-h\fP, \fB\-\-help\fP
.INDENT 0.0
.INDENT 3.5
show this help message and exit
.UNINDENT
.UNINDENT
.sp
\fB\-i\fP, \fB\-\-inventory\fP, \fB\-\-inventory\-file\fP
.INDENT 0.0
.INDENT 3.5
specify inventory host path or comma separated host list. \-\-inventory\-file is deprecated
.UNINDENT
.UNINDENT
.sp
\fB\-k\fP, \fB\-\-ask\-pass\fP
.INDENT 0.0
.INDENT 3.5
ask for connection password
.UNINDENT
.UNINDENT
.sp
\fB\-l\fP \(aqSUBSET\(aq, \fB\-\-limit\fP \(aqSUBSET\(aq
.INDENT 0.0
.INDENT 3.5
further limit selected hosts to an additional pattern
.UNINDENT
.UNINDENT
.sp
\fB\-m\fP \(aqMODULE_NAME\(aq, \fB\-\-module\-name\fP \(aqMODULE_NAME\(aq
.INDENT 0.0
.INDENT 3.5
Repository module name, which ansible will use to check out the repo. Choices are (\(aqgit\(aq, \(aqsubversion\(aq, \(aqhg\(aq, \(aqbzr\(aq). Default is git.
.UNINDENT
.UNINDENT
.sp
\fB\-o\fP, \fB\-\-only\-if\-changed\fP
.INDENT 0.0
.INDENT 3.5
only run the playbook if the repository has been updated
.UNINDENT
.UNINDENT
.sp
\fB\-s\fP \(aqSLEEP\(aq, \fB\-\-sleep\fP \(aqSLEEP\(aq
.INDENT 0.0
.INDENT 3.5
sleep for random interval (between 0 and n number of seconds) before starting. This is a useful way to disperse git requests
.UNINDENT
.UNINDENT
.sp
\fB\-t\fP, \fB\-\-tags\fP
.INDENT 0.0
.INDENT 3.5
only run plays and tasks tagged with these values
.UNINDENT
.UNINDENT
.sp
\fB\-u\fP \(aqREMOTE_USER\(aq, \fB\-\-user\fP \(aqREMOTE_USER\(aq
.INDENT 0.0
.INDENT 3.5
connect as this user (default=None)
.UNINDENT
.UNINDENT
.sp
\fB\-v\fP, \fB\-\-verbose\fP
.INDENT 0.0
.INDENT 3.5
Causes Ansible to print more debug messages. Adding multiple \-v will increase the verbosity, the builtin plugins currently evaluate up to \-vvvvvv. A reasonable level to start is \-vvv, connection debugging might require \-vvvv.
.UNINDENT
.UNINDENT
.SH ENVIRONMENT
.sp
The following environment variables may be specified.
.sp
ANSIBLE_CONFIG \-\- Specify override location for the ansible config file
.sp
Many more are available for most options in ansible.cfg
.sp
For a full list check \fI\%https://docs.ansible.com/\fP\&. or use the \fIansible\-config\fP command.
.SH FILES
.sp
/etc/ansible/ansible.cfg \-\- Config file, used if present
.sp
~/.ansible.cfg \-\- User config file, overrides the default config if present
.sp
\&./ansible.cfg \-\- Local config file (in current working directory) assumed to be \(aqproject specific\(aq and overrides the rest if present.
.sp
As mentioned above, the ANSIBLE_CONFIG environment variable will override all others.
.SH AUTHOR
.sp
Ansible was originally written by Michael DeHaan.
.SH COPYRIGHT
.sp
Copyright © 2018 Red Hat, Inc | Ansible.
Ansible is released under the terms of the GPLv3 license.
.SH SEE ALSO
.sp
\fBansible\fP (1), \fBansible\-config\fP (1), \fBansible\-console\fP (1), \fBansible\-doc\fP (1), \fBansible\-galaxy\fP (1), \fBansible\-inventory\fP (1), \fBansible\-playbook\fP (1), \fBansible\-vault\fP (1)
.sp
Extensive documentation is available in the documentation site:
<\fI\%https://docs.ansible.com\fP>.
IRC and mailing list info can be found in file CONTRIBUTING.md,
available in: <\fI\%https://github.com/ansible/ansible\fP>
.\" Generated by docutils manpage writer.
.