[root@master ~]# ansible-pull --help
Usage: ansible-pull -U <repository> [options] [<playbook.yml>]
pulls playbooks from a VCS repo and executes them forthelocal host
Options:
--accept-host-key adds the hostkey for the repo url if not already added--ask-vault-pass ask for vault password--check don't make any changes; instead, try to predict someofthe changes that may occur
-C CHECKOUT, --checkout=CHECKOUT
branch/tag/commit to checkout. Defaults to behavior of
repository module.
--clean modified files in the working repository will be
discarded
-d DEST, --directory=DEST
directory to checkout repository to
-e EXTRA_VARS, --extra-vars=EXTRA_VARSset additional variables as key=value or YAML/JSON, if
filename prepend with @
-f, --force run the playbook even if the repository could not be
updated
--full Do a full clone, instead of a shallow one.
-h, --help show this help message and exit
-i INVENTORY, --inventory=INVENTORY, --inventory-file=INVENTORY
specify inventory host path or comma separated host
list. --inventory-file is deprecated
-l SUBSET, --limit=SUBSET
further limit selected hosts to an additional pattern
--list-hosts outputs a list of matching hosts; does not execute
anything else
-m MODULE_NAME, --module-name=MODULE_NAME
Repository module name, which ansible will use to
check out the repo. Choices are ('git', 'subversion',
'hg', 'bzr'). Default is git.
-M MODULE_PATH, --module-path=MODULE_PATH
prepend colon-separated path(s) to module library
(default=[u'/root/.ansible/plugins/modules',
u'/usr/share/ansible/plugins/modules'])
-o, --only-if-changed
only runthe playbook ifthe repository has been
updated
--purge purge checkout after playbook run--skip-tags=SKIP_TAGS
only run plays and tasks whose tags do not match these
values
-s SLEEP, --sleep=SLEEP
sleep for random interval (between0and n numberof
seconds) before starting. This is a useful way to
disperse git requests
-t TAGS, --tags=TAGS only run plays and tasks tagged with these values--track-subs submodules will track the latest changes. This is
equivalent to specifying the--remote flag to git
submodule update
-U URL, --url=URL URL of the playbook repository--vault-id=VAULT_IDS the vault identity to use--vault-password-file=VAULT_PASSWORD_FILES
vault password file
-v, --verbose verbose mode (-vvv for more, -vvvv to enable
connection debugging)
--verify-commit verify GPG signature of checked out commit, if it
fails abort runningthe playbook. This needs the
corresponding VCS module to support such an operation
--version show program's version number and exit
Connection Options:
control as whom and how to connect to hosts
-k, --ask-pass ask for connection password--private-key=PRIVATE_KEY_FILE, --key-file=PRIVATE_KEY_FILE
use this fileto authenticate the connection
-u REMOTE_USER, --user=REMOTE_USER
connect as this user (default=None)
-c CONNECTION, --connection=CONNECTION
connection type to use (default=smart)
-T TIMEOUT, --timeout=TIMEOUT
override the connection timeoutin seconds
(default=10)
--ssh-common-args=SSH_COMMON_ARGS
specify common arguments to pass to sftp/scp/ssh (e.g.
ProxyCommand)
--sftp-extra-args=SFTP_EXTRA_ARGS
specify extra arguments to pass to sftp only (e.g. -f,
-l)
--scp-extra-args=SCP_EXTRA_ARGS
specify extra arguments to pass to scp only (e.g. -l)
--ssh-extra-args=SSH_EXTRA_ARGS
specify extra arguments to pass to ssh only (e.g. -R)
Privilege Escalation Options:
control how and which user you become ason target hosts
--ask-sudo-pass ask for sudo password (deprecated, use become)--ask-su-pass ask for su password (deprecated, use become)
-K, --ask-become-pass
ask for privilege escalation password
[root@master ~]# ansible-playbook playbook.yml
PLAY [slave1] *******************************************************************************************************************************************************************************
TASK [Gathering Facts] **********************************************************************************************************************************************************************
fatal: [192.168.27.111]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: ssh: connect to host 192.168.27.111 port 22: No route to host\r\n", "unreachable": true}
to retry, use: --limit @/root/playbook.retry
PLAY RECAP **********************************************************************************************************************************************************************************
192.168.27.111 : ok=0 changed=0 unreachable=1 failed=0