mirror of https://github.com/ansible/ansible.git
added docs to CLI docstringsadded
removed 'now intermediate build files' from repo adjusted gitignorepull/22960/head
parent
424e1946f4
commit
18a7a1ec31
@ -0,0 +1,126 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
import os
|
||||||
|
import io
|
||||||
|
import sys
|
||||||
|
|
||||||
|
from jinja2 import Environment, FileSystemLoader
|
||||||
|
|
||||||
|
def get_options(optlist):
|
||||||
|
''' get actual options '''
|
||||||
|
|
||||||
|
opts = []
|
||||||
|
for opt in optlist:
|
||||||
|
res = {
|
||||||
|
'desc': opt.help,
|
||||||
|
'options': opt._short_opts + opt._long_opts
|
||||||
|
}
|
||||||
|
if opt.action == 'store':
|
||||||
|
res['arg'] = opt.dest.upper()
|
||||||
|
opts.append(res)
|
||||||
|
|
||||||
|
return opts
|
||||||
|
|
||||||
|
def opt_doc_list(cli):
|
||||||
|
''' iterate over options lists '''
|
||||||
|
|
||||||
|
results = []
|
||||||
|
for optg in cli.parser.option_groups:
|
||||||
|
results.extend(get_options(optg.option_list))
|
||||||
|
|
||||||
|
results.extend(get_options(cli.parser.option_list))
|
||||||
|
|
||||||
|
return results
|
||||||
|
|
||||||
|
def opts_docs(cli, name):
|
||||||
|
''' generate doc structure from options '''
|
||||||
|
|
||||||
|
# cli name
|
||||||
|
if '-' in name:
|
||||||
|
name = name.split('-')[1]
|
||||||
|
else:
|
||||||
|
name = 'adhoc'
|
||||||
|
|
||||||
|
# cli info
|
||||||
|
docs = {
|
||||||
|
'cli': name,
|
||||||
|
'usage': cli.parser.usage,
|
||||||
|
'short_desc': cli.parser.description,
|
||||||
|
'long_desc': cli.__doc__,
|
||||||
|
}
|
||||||
|
|
||||||
|
# force populate parser with per action options
|
||||||
|
if cli.VALID_ACTIONS:
|
||||||
|
docs['actions'] = {}
|
||||||
|
# avoid dupe errors
|
||||||
|
cli.parser.set_conflict_handler('resolve')
|
||||||
|
for action in cli.VALID_ACTIONS:
|
||||||
|
cli.args.append(action)
|
||||||
|
cli.set_action()
|
||||||
|
docs['actions'][action] = getattr(cli, 'execute_%s' % action).__doc__
|
||||||
|
|
||||||
|
docs['options'] = opt_doc_list(cli)
|
||||||
|
|
||||||
|
return docs
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
|
||||||
|
template_file = 'man.j2'
|
||||||
|
|
||||||
|
# need to be in right dir
|
||||||
|
os.chdir(os.path.dirname(__file__))
|
||||||
|
|
||||||
|
allvars = {}
|
||||||
|
output = {}
|
||||||
|
cli_list = []
|
||||||
|
for binary in os.listdir('../../lib/ansible/cli'):
|
||||||
|
|
||||||
|
if not binary.endswith('.py'):
|
||||||
|
continue
|
||||||
|
elif binary == '__init__.py':
|
||||||
|
continue
|
||||||
|
|
||||||
|
libname = os.path.splitext(binary)[0]
|
||||||
|
print("Found CLI %s" % libname)
|
||||||
|
|
||||||
|
if libname == 'adhoc':
|
||||||
|
myclass = 'AdHocCLI'
|
||||||
|
output[libname] = 'ansible.1.asciidoc.in'
|
||||||
|
else:
|
||||||
|
myclass = "%sCLI" % libname.capitalize()
|
||||||
|
output[libname] = 'ansible-%s.1.asciidoc.in' % libname
|
||||||
|
|
||||||
|
# instanciate each cli and ask its options
|
||||||
|
mycli = getattr(__import__("ansible.cli.%s" % libname, fromlist=[myclass]), myclass)
|
||||||
|
cli_object = mycli([])
|
||||||
|
try:
|
||||||
|
cli_object.parse()
|
||||||
|
except:
|
||||||
|
# no options passed, we expect errors
|
||||||
|
pass
|
||||||
|
|
||||||
|
allvars[libname] = opts_docs(cli_object, libname)
|
||||||
|
|
||||||
|
for extras in ('ARGUMENTS'):
|
||||||
|
if hasattr(cli_object, extras):
|
||||||
|
allvars[libname][extras.lower()] = getattr(cli_object, extras)
|
||||||
|
|
||||||
|
cli_list = allvars.keys()
|
||||||
|
for libname in cli_list:
|
||||||
|
|
||||||
|
# template it!
|
||||||
|
env = Environment(loader=FileSystemLoader('../templates'))
|
||||||
|
template = env.get_template('man.j2')
|
||||||
|
|
||||||
|
# add rest to vars
|
||||||
|
tvars = allvars[libname]
|
||||||
|
tvars['cli_list'] = cli_list
|
||||||
|
tvars['cli'] = libname
|
||||||
|
if '-i' in tvars['options']:
|
||||||
|
print('uses inventory')
|
||||||
|
|
||||||
|
manpage = template.render(tvars)
|
||||||
|
filename = '../man/man1/%s' % output[libname]
|
||||||
|
with io.open(filename, 'w') as f:
|
||||||
|
f.write(manpage)
|
||||||
|
print("Wrote man docs to %s" % filename)
|
@ -1,261 +0,0 @@
|
|||||||
ansible-console(1)
|
|
||||||
==================
|
|
||||||
:doctype:manpage
|
|
||||||
3:man source: Ansible
|
|
||||||
:man version: %VERSION%
|
|
||||||
:man manual: System administration commands
|
|
||||||
|
|
||||||
NAME
|
|
||||||
----
|
|
||||||
ansible-console - a REPL for ad-hoc ansible tasks
|
|
||||||
|
|
||||||
|
|
||||||
SYNOPSIS
|
|
||||||
--------
|
|
||||||
ansible-console [-m module_name] [-a args] [options] [host-pattern]
|
|
||||||
|
|
||||||
|
|
||||||
DESCRIPTION
|
|
||||||
-----------
|
|
||||||
|
|
||||||
*Ansible console* is a REPL that allows for running ad-hoc tasks against
|
|
||||||
a chosen inventory (based on dominis' ansible-shell).
|
|
||||||
|
|
||||||
|
|
||||||
ARGUMENTS
|
|
||||||
---------
|
|
||||||
|
|
||||||
*host-pattern*::
|
|
||||||
|
|
||||||
A name of a group in the inventory, a shell-like glob selecting
|
|
||||||
hosts in inventory or any combination of the two separated by commas.
|
|
||||||
|
|
||||||
OPTIONS
|
|
||||||
-------
|
|
||||||
|
|
||||||
*-a* \'_ARGUMENTS_', *--args=*\'_ARGUMENTS_'::
|
|
||||||
|
|
||||||
The 'ARGUMENTS' to pass to the module.
|
|
||||||
|
|
||||||
*-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.
|
|
||||||
|
|
||||||
*-B* 'NUM', *--background=*'NUM'::
|
|
||||||
|
|
||||||
Run commands in the background, killing the task after 'NUM' seconds.
|
|
||||||
|
|
||||||
*--become-method=*'BECOME_METHOD'::
|
|
||||||
|
|
||||||
Privilege escalation method to use (default=sudo),
|
|
||||||
valid choices: [ sudo | su | pbrun | pfexec | runas | doas | dzdo ]
|
|
||||||
|
|
||||||
*--become-user=*'BECOME_USER'::
|
|
||||||
|
|
||||||
Run operations as this user (default=root).
|
|
||||||
|
|
||||||
*-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.
|
|
||||||
|
|
||||||
*-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).
|
|
||||||
|
|
||||||
*-f* 'NUM', *--forks=*'NUM'::
|
|
||||||
|
|
||||||
Level of parallelism. 'NUM' is specified as an integer, the default is 5.
|
|
||||||
|
|
||||||
*-h*, *--help*::
|
|
||||||
|
|
||||||
Show help message 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 single host with traling 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.
|
|
||||||
|
|
||||||
*-m* 'NAME', *--module-name=*'NAME'::
|
|
||||||
|
|
||||||
Execute the module called 'NAME'.
|
|
||||||
|
|
||||||
*-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.
|
|
||||||
|
|
||||||
*-o*, *--one-line*::
|
|
||||||
|
|
||||||
Try to output everything on one line.
|
|
||||||
|
|
||||||
*-P* 'NUM', *--poll=*'NUM'::
|
|
||||||
|
|
||||||
Poll a background job every 'NUM' seconds. Requires *-B*.
|
|
||||||
|
|
||||||
*--private-key=*'PRIVATE_KEY_FILE'::
|
|
||||||
|
|
||||||
Use this file to authenticate the connection.
|
|
||||||
|
|
||||||
*-S*, *--su*::
|
|
||||||
|
|
||||||
Run operations with su (deprecated, use become).
|
|
||||||
|
|
||||||
*-R* 'SU_USER', *--se-user=*'SUDO_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).
|
|
||||||
|
|
||||||
*-t* 'DIRECTORY', *--tree=*'DIRECTORY'::
|
|
||||||
|
|
||||||
Save contents in this output 'DIRECTORY', with the results saved in a
|
|
||||||
file named after each host.
|
|
||||||
|
|
||||||
*-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'::
|
|
||||||
|
|
||||||
A file containing the vault password to be used during the decryption of vault encrypted files.
|
|
||||||
Be sure to keep this file secured if it is used. If the file is executable,
|
|
||||||
it will be run and its standard output will be used as the password.
|
|
||||||
|
|
||||||
*-v*, *--verbose*::
|
|
||||||
|
|
||||||
Verbose mode, more output from successful actions will be shown.
|
|
||||||
Give up to three times for more output.
|
|
||||||
|
|
||||||
*--version*::
|
|
||||||
|
|
||||||
Show program version number and exit.
|
|
||||||
|
|
||||||
INVENTORY
|
|
||||||
---------
|
|
||||||
|
|
||||||
Ansible stores the hosts it can potentially operate on in an inventory.
|
|
||||||
This can be an ini-like file, a script, directory or a list.
|
|
||||||
The ini 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.
|
|
||||||
|
|
||||||
Ranges of hosts are also supported. For more information and
|
|
||||||
additional options, see the documentation on http://docs.ansible.com/.
|
|
||||||
|
|
||||||
|
|
||||||
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-playbook*(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>
|
|
@ -1,91 +0,0 @@
|
|||||||
ansible-doc(1)
|
|
||||||
==============
|
|
||||||
:doctype: manpage
|
|
||||||
:man source: Ansible
|
|
||||||
:man version: %VERSION%
|
|
||||||
:man manual: System administration commands
|
|
||||||
|
|
||||||
NAME
|
|
||||||
----
|
|
||||||
ansible-doc - show documentation on Ansible plugins
|
|
||||||
|
|
||||||
|
|
||||||
SYNOPSIS
|
|
||||||
--------
|
|
||||||
ansible-doc [-M plugin_path] [-l] [-s] [-t <type>] [plugin...]
|
|
||||||
|
|
||||||
|
|
||||||
DESCRIPTION
|
|
||||||
-----------
|
|
||||||
|
|
||||||
*ansible-doc* displays information on modules installed in Ansible
|
|
||||||
libraries. It displays a terse listing of plugins and their short
|
|
||||||
descriptions, provides a printout of their DOCUMENTATION strings,
|
|
||||||
and it can create a short "snippet" which can be pasted into a
|
|
||||||
playbook.
|
|
||||||
|
|
||||||
|
|
||||||
OPTIONS
|
|
||||||
-------
|
|
||||||
|
|
||||||
*-M* 'DIRECTORY', *--plugin-path=*'DIRECTORY'::
|
|
||||||
|
|
||||||
The 'DIRECTORY' search path to load plugins from.
|
|
||||||
If not specified Ansbile uses it's normal search path and configuration.
|
|
||||||
|
|
||||||
*-s*, *--snippet=*::
|
|
||||||
|
|
||||||
Produce a snippet which can be copied into a playbook for modification, like a kind of task template.
|
|
||||||
|
|
||||||
*-l*, *--list=*::
|
|
||||||
|
|
||||||
Produce a terse listing of plugins and a short description of each.
|
|
||||||
|
|
||||||
*-t*, *--type=*::
|
|
||||||
|
|
||||||
Specify the type of plugin to target, default is 'module'.
|
|
||||||
Other choices are 'cache', 'callback', 'connection', 'lookup' and 'strategy'.
|
|
||||||
|
|
||||||
ENVIRONMENT
|
|
||||||
-----------
|
|
||||||
|
|
||||||
ANSIBLE_CONFIG -- Configuration file to use
|
|
||||||
ANSIBLE_LIBRARY -- Override the default ansible module library path
|
|
||||||
ANSIBLE_CACHE_PLUGINS -- Override the default ansible cache plugin path
|
|
||||||
ANSIBLE_CALLBACK_PLUGINS -- Override the default ansible callback plugin path
|
|
||||||
ANSIBLE_CONNECTION_PLUGINS -- Override the default ansible connection plugin path
|
|
||||||
ANSIBLE_LOOKUP_PLUGINS -- Override the default ansible lookup plugin path
|
|
||||||
ANSIBLE_STRATEGY_PLUGINS -- Override the default ansible strategy plugin path
|
|
||||||
|
|
||||||
|
|
||||||
FILES
|
|
||||||
-----
|
|
||||||
|
|
||||||
/etc/ansible/ansible.cfg -- Config file, used if present
|
|
||||||
|
|
||||||
~/.ansible.cfg -- User config file, overrides the default config if present
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
AUTHOR
|
|
||||||
------
|
|
||||||
|
|
||||||
ansible-doc was originally written by Jan-Piet Mens. See the AUTHORS file for a complete list of contributors.
|
|
||||||
|
|
||||||
|
|
||||||
COPYRIGHT
|
|
||||||
---------
|
|
||||||
|
|
||||||
Copyright © 2012, Jan-Piet Mens
|
|
||||||
|
|
||||||
Ansible is released under the terms of the GPLv3 License.
|
|
||||||
|
|
||||||
|
|
||||||
SEE ALSO
|
|
||||||
--------
|
|
||||||
|
|
||||||
*ansible-playbook*(1), *ansible*(1), *ansible-pull*(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>
|
|
@ -1,384 +0,0 @@
|
|||||||
ansible-galaxy(1)
|
|
||||||
===================
|
|
||||||
:doctype: manpage
|
|
||||||
:man source: Ansible
|
|
||||||
:man version: %VERSION%
|
|
||||||
:man manual: System administration commands
|
|
||||||
|
|
||||||
NAME
|
|
||||||
----
|
|
||||||
ansible-galaxy - manage roles using galaxy.ansible.com
|
|
||||||
|
|
||||||
|
|
||||||
SYNOPSIS
|
|
||||||
--------
|
|
||||||
ansible-galaxy [delete|import|info|init|install|list|login|remove|search|setup] [--help] [options] ...
|
|
||||||
|
|
||||||
|
|
||||||
DESCRIPTION
|
|
||||||
-----------
|
|
||||||
|
|
||||||
*Ansible Galaxy* is a shared repository for Ansible roles.
|
|
||||||
The ansible-galaxy command can be used to manage these roles,
|
|
||||||
or for creating a skeleton framework for roles you'd like to upload to Galaxy.
|
|
||||||
|
|
||||||
COMMON OPTIONS
|
|
||||||
--------------
|
|
||||||
|
|
||||||
*-h*, *--help*::
|
|
||||||
|
|
||||||
Show a help message related to the given sub-command.
|
|
||||||
|
|
||||||
INSTALL
|
|
||||||
-------
|
|
||||||
|
|
||||||
The *install* sub-command is used to install roles.
|
|
||||||
|
|
||||||
USAGE
|
|
||||||
~~~~~
|
|
||||||
|
|
||||||
$ ansible-galaxy install [options] [-r FILE | role_name(s)[,version] | tar_file(s)]
|
|
||||||
|
|
||||||
Roles can be installed in several different ways:
|
|
||||||
|
|
||||||
* A username.rolename[,version] - this will install a single role. The Galaxy
|
|
||||||
API will be contacted to provide the information about the role, and the
|
|
||||||
corresponding .tar.gz will be downloaded from *github.com*. If the version
|
|
||||||
is omitted, the most recent version available will be installed.
|
|
||||||
|
|
||||||
* A file name, using *-r* - this will install multiple roles listed one per
|
|
||||||
line. The format of each line is the same as above: username.rolename[,version]
|
|
||||||
|
|
||||||
* A .tar.gz of a valid role you've downloaded directly from *github.com*. This
|
|
||||||
is mainly useful when the system running Ansible does not have access to
|
|
||||||
the Galaxy API, for instance when behind a firewall or proxy.
|
|
||||||
|
|
||||||
|
|
||||||
OPTIONS
|
|
||||||
~~~~~~~
|
|
||||||
|
|
||||||
*-f*, *--force*::
|
|
||||||
|
|
||||||
Force overwriting an existing role.
|
|
||||||
|
|
||||||
*-i*, *--ignore-errors*::
|
|
||||||
|
|
||||||
Ignore errors and continue with the next specified role.
|
|
||||||
|
|
||||||
*-n*, *--no-deps*::
|
|
||||||
|
|
||||||
Don't download roles listed as dependencies.
|
|
||||||
|
|
||||||
*-p* 'ROLES_PATH', *--roles-path=*'ROLES_PATH'::
|
|
||||||
|
|
||||||
The path to the directory containing your roles. The default is the *roles_path*
|
|
||||||
configured in your *ansible.cfg* file (/etc/ansible/roles if not configured)
|
|
||||||
|
|
||||||
*-r* 'ROLE_FILE', *--role-file=*'ROLE_FILE'::
|
|
||||||
|
|
||||||
A file containing a list of roles to be imported, as specified above. This
|
|
||||||
option cannot be used if a rolename or .tar.gz have been specified.
|
|
||||||
|
|
||||||
REMOVE
|
|
||||||
------
|
|
||||||
|
|
||||||
The *remove* sub-command is used to remove one or more roles.
|
|
||||||
|
|
||||||
USAGE
|
|
||||||
~~~~~
|
|
||||||
|
|
||||||
$ ansible-galaxy remove role1 role2 ...
|
|
||||||
|
|
||||||
OPTIONS
|
|
||||||
~~~~~~~
|
|
||||||
|
|
||||||
*-p* 'ROLES_PATH', *--roles-path=*'ROLES_PATH'::
|
|
||||||
|
|
||||||
The path to the directory containing your roles. The default is the *roles_path*
|
|
||||||
configured in your *ansible.cfg* file (/etc/ansible/roles if not configured)
|
|
||||||
|
|
||||||
INIT
|
|
||||||
----
|
|
||||||
|
|
||||||
The *init* command is used to create a new role suitable for uploading
|
|
||||||
to https://galaxy.ansible.com (or for roles in general). Creates a skeleton
|
|
||||||
directory structure and default files.
|
|
||||||
|
|
||||||
USAGE
|
|
||||||
~~~~~
|
|
||||||
|
|
||||||
$ ansible-galaxy init [options] role_name
|
|
||||||
|
|
||||||
OPTIONS
|
|
||||||
~~~~~~~
|
|
||||||
|
|
||||||
*-f*, *--force*::
|
|
||||||
|
|
||||||
Force overwriting an existing role.
|
|
||||||
|
|
||||||
*-p* 'INIT_PATH', *--init-path=*'INIT_PATH'::
|
|
||||||
|
|
||||||
The path in which the skeleton role will be created.The default is the current
|
|
||||||
working directory.
|
|
||||||
|
|
||||||
*--offline*::
|
|
||||||
|
|
||||||
Don't query the galaxy API when creating roles
|
|
||||||
|
|
||||||
*--container-enabled*::
|
|
||||||
|
|
||||||
Initialize the new role with files appropriate for a Container Enabled role.
|
|
||||||
|
|
||||||
*--role-skeleton=*'ROLE_SKELETON'::
|
|
||||||
|
|
||||||
By default a new role is based on a template delivered with Ansible. Use
|
|
||||||
this option to provide an alternate template. Specify a path to a directory
|
|
||||||
that contains subdirectories and Jinja templates from which to base the new
|
|
||||||
role. Alternatively, the role_skeleton option can be configured in
|
|
||||||
*ansible.cfg*.
|
|
||||||
|
|
||||||
LIST
|
|
||||||
----
|
|
||||||
|
|
||||||
The *list* sub-command is used to show what roles are currently installed.
|
|
||||||
You can specify a role name, and if installed only that role will be shown.
|
|
||||||
|
|
||||||
USAGE
|
|
||||||
~~~~~
|
|
||||||
|
|
||||||
$ ansible-galaxy list [role_name]
|
|
||||||
|
|
||||||
OPTIONS
|
|
||||||
~~~~~~~
|
|
||||||
|
|
||||||
*-p* 'ROLES_PATH', *--roles-path=*'ROLES_PATH'::
|
|
||||||
|
|
||||||
The path to the directory containing your roles. The default is the *roles_path*
|
|
||||||
configured in your *ansible.cfg* file (/etc/ansible/roles if not configured)
|
|
||||||
|
|
||||||
|
|
||||||
SEARCH
|
|
||||||
------
|
|
||||||
|
|
||||||
The *search* sub-command returns a filtered list of roles found on the remote
|
|
||||||
server.
|
|
||||||
|
|
||||||
|
|
||||||
USAGE
|
|
||||||
~~~~~
|
|
||||||
|
|
||||||
$ ansible-galaxy search [options] [searchterm1 searchterm2]
|
|
||||||
|
|
||||||
|
|
||||||
OPTIONS
|
|
||||||
~~~~~~~
|
|
||||||
*--galaxy-tags*::
|
|
||||||
|
|
||||||
Provide a comma separated list of Galaxy Tags on which to filter.
|
|
||||||
|
|
||||||
*--platforms*::
|
|
||||||
|
|
||||||
Provide a comma separated list of Platforms on which to filter.
|
|
||||||
|
|
||||||
*--author*::
|
|
||||||
|
|
||||||
Specify the username of a Galaxy contributor on which to filter.
|
|
||||||
|
|
||||||
*-c*, *--ignore-certs*::
|
|
||||||
|
|
||||||
Ignore TLS certificate errors.
|
|
||||||
|
|
||||||
*-s*, *--server*::
|
|
||||||
|
|
||||||
Override the default server https://galaxy.ansible.com.
|
|
||||||
|
|
||||||
|
|
||||||
INFO
|
|
||||||
----
|
|
||||||
|
|
||||||
The *info* sub-command shows detailed information for a specific role.
|
|
||||||
Details returned about the role included information from the local copy
|
|
||||||
as well as information from galaxy.ansible.com.
|
|
||||||
|
|
||||||
USAGE
|
|
||||||
~~~~~
|
|
||||||
|
|
||||||
$ ansible-galaxy info [options] role_name[, version]
|
|
||||||
|
|
||||||
OPTIONS
|
|
||||||
~~~~~~~
|
|
||||||
|
|
||||||
*-p* 'ROLES_PATH', *--roles-path=*'ROLES_PATH'::
|
|
||||||
|
|
||||||
The path to the directory containing your roles. The default is the *roles_path*
|
|
||||||
configured in your *ansible.cfg* file (/etc/ansible/roles if not configured)
|
|
||||||
|
|
||||||
*-c*, *--ignore-certs*::
|
|
||||||
|
|
||||||
Ignore TLS certificate errors.
|
|
||||||
|
|
||||||
*-s*, *--server*::
|
|
||||||
|
|
||||||
Override the default server https://galaxy.ansible.com.
|
|
||||||
|
|
||||||
|
|
||||||
LOGIN
|
|
||||||
-----
|
|
||||||
|
|
||||||
The *login* sub-command is used to authenticate with galaxy.ansible.com.
|
|
||||||
Authentication is required to use the import, delete and setup commands.
|
|
||||||
It will authenticate the user, retrieve a token from Galaxy, and store it
|
|
||||||
in the user's home directory.
|
|
||||||
|
|
||||||
USAGE
|
|
||||||
~~~~~
|
|
||||||
|
|
||||||
$ ansible-galaxy login [options]
|
|
||||||
|
|
||||||
The *login* sub-command prompts for a *GitHub* username and password. It does
|
|
||||||
NOT send your password to Galaxy. It actually authenticates with GitHub and
|
|
||||||
creates a personal access token. It then sends the personal access token to
|
|
||||||
Galaxy, which in turn verifies that you are you and returns a Galaxy access
|
|
||||||
token. After authentication completes the *GitHub* personal access token is
|
|
||||||
destroyed.
|
|
||||||
|
|
||||||
If you do not wish to use your GitHub password, or if you have two-factor
|
|
||||||
authentication enabled with GitHub, use the *--github-token* option to pass a
|
|
||||||
personal access token that you create. Log into GitHub, go to Settings and
|
|
||||||
click on Personal Access Token to create a token.
|
|
||||||
|
|
||||||
OPTIONS
|
|
||||||
~~~~~~~
|
|
||||||
|
|
||||||
*-c*, *--ignore-certs*::
|
|
||||||
|
|
||||||
Ignore TLS certificate errors.
|
|
||||||
|
|
||||||
*-s*, *--server*::
|
|
||||||
|
|
||||||
Override the default server https://galaxy.ansible.com.
|
|
||||||
|
|
||||||
*--github-token*::
|
|
||||||
|
|
||||||
Authenticate using a *GitHub* personal access token rather than a password.
|
|
||||||
|
|
||||||
|
|
||||||
IMPORT
|
|
||||||
------
|
|
||||||
|
|
||||||
Import a role from *GitHub* to galaxy.ansible.com. Requires the user first
|
|
||||||
authenticate with galaxy.ansible.com using the *login* subcommand.
|
|
||||||
|
|
||||||
USAGE
|
|
||||||
~~~~~
|
|
||||||
|
|
||||||
$ ansible-galaxy import [options] github_user github_repo
|
|
||||||
|
|
||||||
OPTIONS
|
|
||||||
~~~~~~~
|
|
||||||
*-c*, *--ignore-certs*::
|
|
||||||
|
|
||||||
Ignore TLS certificate errors.
|
|
||||||
|
|
||||||
*-s*, *--server*::
|
|
||||||
|
|
||||||
Override the default server https://galaxy.ansible.com.
|
|
||||||
|
|
||||||
*--branch*::
|
|
||||||
|
|
||||||
Provide a specific branch to import. When a branch is not specified the
|
|
||||||
branch found in meta/main.yml is used. If no branch is specified in
|
|
||||||
meta/main.yml, the repo's default branch (usually master) is used.
|
|
||||||
|
|
||||||
*--role-name*::
|
|
||||||
|
|
||||||
Set the name of the role. Otherwise, the name is derived from the
|
|
||||||
name of the GitHub repository.
|
|
||||||
|
|
||||||
DELETE
|
|
||||||
------
|
|
||||||
|
|
||||||
The *delete* sub-command will delete a role from galaxy.ansible.com. Requires
|
|
||||||
the user first authenticate with galaxy.ansible.com using the *login* subcommand.
|
|
||||||
|
|
||||||
USAGE
|
|
||||||
~~~~~
|
|
||||||
|
|
||||||
$ ansible-galaxy delete [options] github_user github_repo
|
|
||||||
|
|
||||||
OPTIONS
|
|
||||||
~~~~~~~
|
|
||||||
|
|
||||||
*-c*, *--ignore-certs*::
|
|
||||||
|
|
||||||
Ignore TLS certificate errors.
|
|
||||||
|
|
||||||
*-s*, *--server*::
|
|
||||||
|
|
||||||
Override the default server https://galaxy.ansible.com.
|
|
||||||
|
|
||||||
|
|
||||||
SETUP
|
|
||||||
-----
|
|
||||||
|
|
||||||
The *setup* sub-command creates an integration point for *Travis CI*, enabling
|
|
||||||
galaxy.ansible.com to receive notifications from *Travis* on build completion.
|
|
||||||
Requires the user first authenticate with galaxy.ansible.com using the *login*
|
|
||||||
subcommand.
|
|
||||||
|
|
||||||
USAGE
|
|
||||||
~~~~~
|
|
||||||
|
|
||||||
$ ansible-galaxy setup [options] source github_user github_repo secret
|
|
||||||
|
|
||||||
* Use *travis* as the source value. In the future additional source values may
|
|
||||||
be added.
|
|
||||||
|
|
||||||
* Provide your *Travis* user token as the secret. The token is not stored by
|
|
||||||
galaxy.ansible.com. A hash is created using github_user, github_repo
|
|
||||||
and your token. The hash value is what actually gets stored.
|
|
||||||
|
|
||||||
OPTIONS
|
|
||||||
~~~~~~~
|
|
||||||
|
|
||||||
*-c*, *--ignore-certs*::
|
|
||||||
|
|
||||||
Ignore TLS certificate errors.
|
|
||||||
|
|
||||||
*-s*, *--server*::
|
|
||||||
|
|
||||||
Override the default server https://galaxy.ansible.com.
|
|
||||||
|
|
||||||
--list::
|
|
||||||
|
|
||||||
Show your configured integrations. Provides the ID of each integration
|
|
||||||
which can be used with the remove option.
|
|
||||||
|
|
||||||
--remove::
|
|
||||||
|
|
||||||
Remove a specific integration. Provide the ID of the integration to
|
|
||||||
be removed.
|
|
||||||
|
|
||||||
AUTHOR
|
|
||||||
------
|
|
||||||
|
|
||||||
Ansible was originally written by Michael DeHaan. See the AUTHORS file
|
|
||||||
for a complete list of contributors.
|
|
||||||
|
|
||||||
|
|
||||||
COPYRIGHT
|
|
||||||
---------
|
|
||||||
|
|
||||||
Copyright © 2014, Michael DeHaan
|
|
||||||
|
|
||||||
Ansible is released under the terms of the GPLv3 License.
|
|
||||||
|
|
||||||
|
|
||||||
SEE ALSO
|
|
||||||
--------
|
|
||||||
|
|
||||||
*ansible*(1), *ansible-pull*(1), *ansible-doc*(1), *ansible-playbook*(1), *ansible-vault*(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>
|
|
@ -1,275 +0,0 @@
|
|||||||
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>
|
|
@ -1,238 +0,0 @@
|
|||||||
ansible(1)
|
|
||||||
=========
|
|
||||||
:doctype: manpage
|
|
||||||
:man source: Ansible
|
|
||||||
:man version: %VERSION%
|
|
||||||
:man manual: System administration commands
|
|
||||||
|
|
||||||
|
|
||||||
NAME
|
|
||||||
----
|
|
||||||
ansible-pull - pull playbooks from VCS server and run them using this machine as the target.
|
|
||||||
|
|
||||||
|
|
||||||
SYNOPSIS
|
|
||||||
--------
|
|
||||||
ansible-pull -U URL [options] [ <filename.yml> ]
|
|
||||||
|
|
||||||
|
|
||||||
DESCRIPTION
|
|
||||||
-----------
|
|
||||||
|
|
||||||
*Ansible* is an extra-simple tool/framework/API for doing \'remote things'.
|
|
||||||
|
|
||||||
Use ansible-pull to set up 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 *push* architecture of
|
|
||||||
ansible into a *pull* architecture, which has near-limitless scaling
|
|
||||||
potential.
|
|
||||||
|
|
||||||
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 'fetch' module to retrieve logs from
|
|
||||||
ansible-pull runs would be an excellent way to gather and analyze
|
|
||||||
remote logs from ansible-pull.
|
|
||||||
|
|
||||||
|
|
||||||
OPTIONAL ARGUMENT
|
|
||||||
-----------------
|
|
||||||
|
|
||||||
*filename.yml*::
|
|
||||||
|
|
||||||
The name of one the YAML format files to run as an ansible playbook. This can
|
|
||||||
be a relative path within the checkout. If not provided, ansible-pull
|
|
||||||
will look for a playbook based on the host's fully-qualified domain name, on the
|
|
||||||
host hostname and finally a playbook named *local.yml*.
|
|
||||||
|
|
||||||
|
|
||||||
OPTIONS
|
|
||||||
-------
|
|
||||||
|
|
||||||
*--accept-host-key*::
|
|
||||||
|
|
||||||
Adds the hostkey for the repo URL if not already added.
|
|
||||||
|
|
||||||
*-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* 'CHECKOUT', *--checkout=*'CHECKOUT'::
|
|
||||||
|
|
||||||
Branch/Tag/Commit to checkout. If not provided, uses default behavior of module used to check out playbook repository.
|
|
||||||
|
|
||||||
*-d* 'DEST', *--directory=*'DEST'::
|
|
||||||
|
|
||||||
Directory to checkout repository into. If not provided, a subdirectory of ~/.ansible/pull/ will be 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).
|
|
||||||
|
|
||||||
*-f*, *--force*::
|
|
||||||
|
|
||||||
Force running of playbook even if unable to update playbook repository. This
|
|
||||||
can be useful, for example, to enforce run-time state when a network
|
|
||||||
connection may not always be up or possible.
|
|
||||||
|
|
||||||
*--full*::
|
|
||||||
|
|
||||||
Do a full clone of the repository. By default ansible-pull will do a shallow clone based on the last revision.
|
|
||||||
|
|
||||||
*-h*, *--help*::
|
|
||||||
|
|
||||||
Show the help message 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 single host with traling comma 'host,'.
|
|
||||||
|
|
||||||
*--private-key=*'PRIVATE_KEY_FILE'::
|
|
||||||
|
|
||||||
Use this file to authenticate the connection.
|
|
||||||
|
|
||||||
*-m* 'NAME', *--module-name=*'NAME'::
|
|
||||||
|
|
||||||
Module used to checkout playbook repository. Defaults to git.
|
|
||||||
|
|
||||||
*-o*, *--only-if-changed*::
|
|
||||||
|
|
||||||
Only run the playbook if the repository has been updated.
|
|
||||||
|
|
||||||
*--purge*::
|
|
||||||
|
|
||||||
Purge the checkout after the playbook is run.
|
|
||||||
|
|
||||||
*-s* 'SLEEP', *--sleep=*'SLEEP'::
|
|
||||||
|
|
||||||
Sleep for random interval (between 0 and SLEEP number of seconds) before starting. This is a useful way to disperse git requests.
|
|
||||||
|
|
||||||
*--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.
|
|
||||||
|
|
||||||
*-t* 'TAGS', *--tags=*'TAGS'::
|
|
||||||
|
|
||||||
Only run plays and tasks tagged with these values.
|
|
||||||
|
|
||||||
*-U* 'URL', *--url=*'URL'::
|
|
||||||
|
|
||||||
URL of the playbook repository to checkout.
|
|
||||||
|
|
||||||
*--vault-password-file=*'VAULT_PASSWORD_FILE'::
|
|
||||||
|
|
||||||
Vault password file.
|
|
||||||
|
|
||||||
*--clean*::
|
|
||||||
|
|
||||||
Modified files in the working repository will be discarded.
|
|
||||||
|
|
||||||
*--track-subs*::
|
|
||||||
|
|
||||||
Submodules will track the latest changes.
|
|
||||||
|
|
||||||
*-v*, *--verbose*::
|
|
||||||
|
|
||||||
Pass -vvv to ansible-playbook.
|
|
||||||
|
|
||||||
|
|
||||||
INVENTORY
|
|
||||||
---------
|
|
||||||
|
|
||||||
Ansible stores the hosts it can potentially operate on in an inventory.
|
|
||||||
This can be an ini-like file, a script, directory or a list.
|
|
||||||
The ini 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.
|
|
||||||
|
|
||||||
Ranges of hosts are also supported. For more information and
|
|
||||||
additional options, see the documentation on http://docs.ansible.com/.
|
|
||||||
|
|
||||||
|
|
||||||
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-playbook*(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>
|
|
@ -1,260 +0,0 @@
|
|||||||
ansible(1)
|
|
||||||
=========
|
|
||||||
:man source: Ansible
|
|
||||||
:man version: %VERSION%
|
|
||||||
:man manual: System administration commands
|
|
||||||
|
|
||||||
NAME
|
|
||||||
----
|
|
||||||
ansible - run a task on a target host(s)
|
|
||||||
|
|
||||||
|
|
||||||
SYNOPSIS
|
|
||||||
--------
|
|
||||||
ansible <host-pattern> [-m module_name] [-a args] [options]
|
|
||||||
|
|
||||||
|
|
||||||
DESCRIPTION
|
|
||||||
-----------
|
|
||||||
|
|
||||||
*Ansible* is an extra-simple tool/framework/API for doing \'remote things'.
|
|
||||||
This is the adhoc command that allows for a \'single task playbook' run.
|
|
||||||
|
|
||||||
|
|
||||||
ARGUMENTS
|
|
||||||
---------
|
|
||||||
|
|
||||||
*host-pattern*::
|
|
||||||
|
|
||||||
A name of a group in the inventory, a shell-like glob selecting
|
|
||||||
hosts in inventory or any combination of the two separated by commas.
|
|
||||||
|
|
||||||
OPTIONS
|
|
||||||
-------
|
|
||||||
|
|
||||||
*-a* \'_ARGUMENTS_', *--args=*\'_ARGUMENTS_'::
|
|
||||||
|
|
||||||
The 'ARGUMENTS' to pass to the module.
|
|
||||||
|
|
||||||
*-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.
|
|
||||||
|
|
||||||
*-B* 'NUM', *--background=*'NUM'::
|
|
||||||
|
|
||||||
Run commands in the background, killing the task after 'NUM' seconds.
|
|
||||||
|
|
||||||
*--become-method=*'BECOME_METHOD'::
|
|
||||||
|
|
||||||
Privilege escalation method to use (default=sudo),
|
|
||||||
valid choices: [ sudo | su | pbrun | pfexec | doas | dzdo | ksu ]
|
|
||||||
|
|
||||||
*--become-user=*'BECOME_USER'::
|
|
||||||
|
|
||||||
Run operations as this user (default=root).
|
|
||||||
|
|
||||||
*-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.
|
|
||||||
|
|
||||||
*-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).
|
|
||||||
|
|
||||||
*-f* 'NUM', *--forks=*'NUM'::
|
|
||||||
|
|
||||||
Level of parallelism. 'NUM' is specified as an integer, the default is 5.
|
|
||||||
|
|
||||||
*-h*, *--help*::
|
|
||||||
|
|
||||||
Show help message 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 single host with 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.
|
|
||||||
|
|
||||||
*-m* 'NAME', *--module-name=*'NAME'::
|
|
||||||
|
|
||||||
Execute the module called 'NAME'.
|
|
||||||
|
|
||||||
*-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.
|
|
||||||
|
|
||||||
*-o*, *--one-line*::
|
|
||||||
|
|
||||||
Try to output everything on one line.
|
|
||||||
|
|
||||||
*-P* 'NUM', *--poll=*'NUM'::
|
|
||||||
|
|
||||||
Poll a background job every 'NUM' seconds. Requires *-B*.
|
|
||||||
|
|
||||||
*--private-key=*'PRIVATE_KEY_FILE'::
|
|
||||||
|
|
||||||
Use this file to authenticate the connection.
|
|
||||||
|
|
||||||
*-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).
|
|
||||||
|
|
||||||
*-t* 'DIRECTORY', *--tree=*'DIRECTORY'::
|
|
||||||
|
|
||||||
Save contents in this output 'DIRECTORY', with the results saved in a
|
|
||||||
file named after each host.
|
|
||||||
|
|
||||||
*-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'::
|
|
||||||
|
|
||||||
A file containing the vault password to be used during the decryption of vault encrypted files.
|
|
||||||
Be sure to keep this file secured if it is used. If the file is executable,
|
|
||||||
it will be run and its standard output will be used as the password.
|
|
||||||
|
|
||||||
*-v*, *--verbose*::
|
|
||||||
|
|
||||||
Verbose mode, more output from successful actions will be shown.
|
|
||||||
Give up to three times for more output.
|
|
||||||
|
|
||||||
*--version*::
|
|
||||||
|
|
||||||
Show program version number and exit.
|
|
||||||
|
|
||||||
INVENTORY
|
|
||||||
---------
|
|
||||||
|
|
||||||
Ansible stores the hosts it can potentially operate on in an inventory.
|
|
||||||
This can be an ini-like file, a script, directory or a list.
|
|
||||||
The ini 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.
|
|
||||||
|
|
||||||
Ranges of hosts are also supported. For more information and
|
|
||||||
additional options, see the documentation on http://docs.ansible.com/.
|
|
||||||
|
|
||||||
|
|
||||||
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-playbook*(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>
|
|
Loading…
Reference in New Issue