ansible-pull
Pull and run playbooks from a repository
TLDR
Pull and run playbook from git
SYNOPSIS
ansible-pull -U repourl [-C branch] [-d dest] [playbook.yml_]
DESCRIPTION
ansible-pull inverts the normal Ansible push model by having nodes pull configuration from a central repository. Nodes periodically fetch a git repository containing playbooks and run them locally.
This is useful for scaling to many nodes, bootstrap scenarios, or environments where nodes initiate their own configuration.
PARAMETERS
-U url, --url url
Git repository URL-C branch, --checkout branch
Branch, tag, or commit to checkout-d dir, --directory dir
Local directory for repository-i inventory
Inventory (often "localhost,")-o, --only-if-changed
Only run playbook if repo changed--sleep seconds
Random sleep before running (for staggering)--purge
Delete local repo before cloning-f, --force
Force run even if checkout fails--full
Full clone instead of shallow--accept-host-key
Accept SSH host key
CONFIGURATION
/etc/ansible/ansible.cfg
System-wide Ansible configuration on the target node.~/.ansible.cfg
Per-user Ansible configuration overriding system defaults.ansible.cfg
Project-level configuration in the current directory, highest priority.
CAVEATS
Requires git and ansible on the target node. Credentials for private repos need configuration. Failure leaves node in potentially inconsistent state.
HISTORY
ansible-pull was introduced to support pull-based configuration management, addressing scalability concerns with the traditional push model.
SEE ALSO
ansible-playbook(1), ansible(1), git(1)
