Commit Graph

43 Commits (9765a80bd41548f3d632c592a0519f768d86340b)

Author SHA1 Message Date
James Cammarata ce3ef7f4c1 Making the switch to v2 10 years ago
Steve Gargan 4ce791fe84 avoid path issues by determining the path of ansible-pull and using its path to run ansible and ansible-playbook 10 years ago
Matt Martz 68358e31fb Allow ansible (ad-hoc) to support --extra-vars also 10 years ago
Max Riveiro 9e8dae7498
Fix #6346. Add key_file and accept_hostkey to ansible-pull
Signed-off-by: Max Riveiro <kavu13@gmail.com>
10 years ago
Sören Tempel 773849d421 Only write actual errors to stderr 10 years ago
mmicael1 a33dccfa61 Add tags options
Add -t OR --tags options to pass to ansible-playbook
10 years ago
Will Thames 1787c29354 Improved inventory handling when inventory does not yet exist
Fixes #8324
Improves #7667
10 years ago
Will Thames 92f9b74a68 Restrict ansible-pull to only do scm checkout once
This addresses a bug in ansible-pull where running ansible-pull
with an existing inventory causes the ansible job that does
the SCM checkout to run twice - once for localhost and once
for the fully qualified hostname.

This can cause a race condition, and usually results in one
of the ansible checkouts failing because one of the scm checkouts
has its references updated underneath it. Although the SCM checkout
actually succeeds, ansible fails with non-zero exit status, and
so ansible-pull does not continue.

Now that localhost is implicit for ansible runs, the ansible
scm checkout can be done using just localhost as a target.
10 years ago
Alex Chistyakov bb1941a906 ansible-pull should respect inventory file settings because, say, Python interpreter path can be non-default on a host 11 years ago
James Tanner c09e46517e Merge pull request #5864 from stevetjoa/ansible
adding -K flag for ask-sudo-pass to ansible-pull
11 years ago
Michael DeHaan 71977bfe71 Merge pull request #5720 from mschurenko/devel
added random sleep option to ansible-pull
11 years ago
Michael DeHaan 0ab6586222 Merge pull request #5890 from ingmar/ansiblepull-extravars-5707
ansible-pull support for -e (--extra-vars) option (same as ansible-playbook) #5707
11 years ago
James Tanner e3672dded0 Remove breakpoint 11 years ago
James Tanner b74105c689 Add --vault-password-file to bin/ansible-pull 11 years ago
Ingmar Hupp 1f0cdc5ec8 ansible-pull support for -e (--extra-vars) option (same as ansible-playbook) #5707 11 years ago
Steve Tjoa 335bc1ee5c adding -K flag for ask-sudo-pass to ansible-pull 11 years ago
Matt 1ef8f279b9 added random sleep option to ansible-pull 11 years ago
James Tanner 78ec7c736f Fixes #3973 Second Revision of live ansible-pull output 11 years ago
James Tanner ebeaf785b5 Revert "Fixes #3973 live output for ansible-pull"
This reverts commit 3b2a35ae00.
11 years ago
James Tanner 3b2a35ae00 Fixes #3973 live output for ansible-pull
Add a -v/--verbose option to ansible-pull to allow passing -vvvv to
ansible-playbook and to show stdout while the playbook executes
11 years ago
jctanner 2d9087b806 Merge pull request #4484 from mscherer/add_short_hostname
ansible-pull by default will look for local.yml and $fqdn.yml.
11 years ago
Michael Scherer f8b23e5721 add a default value for the -d option of ansible-pull
Thi permit to simplify the command line to use by using
a sensible default, and so reduce the number of incorrect
possible choices and setup needed. Among potential
incorrect choices is using a fixed directory in /tmp, which
could be problematic with a setup whose access is not
properly restricted.
11 years ago
Michael Scherer 92147aff0f also fix the doc, forgot in last commit 11 years ago
Michael Scherer 4b067fa47e ansible-pull by default will look for local.yml and $fqdn.yml.
For a small network ( home, small company ), having to put the FQDN
in each file is a bit tedious, so this patch also add the shorthostname
as a 3rd default if the fqdn is not found.
11 years ago
James Cammarata 51638df48f Minor format fix in ansible-pull related to the -f patch 11 years ago
John Florian c8a5aabf39 Added -f/--force option to ansible-pull 11 years ago
Stephen Fromm cc3651592b Extend ansible-pull to support other source repositories
This extends ansible-pull so that it can support using other
source_control modules for checking out a playbook repository
(issue #3372).  This will check to see if the module exists before
it attempts to do the checkout and will exit if the module is not found.
It requires that the module used to check out the repository support the
parameters 'name' and 'version'.  The option -C, --checkout is now
optional and defaults to the module's default behavior for selecting a
branch, tag, or commit value.  For git, this continues to be HEAD.

Other changes include:
* Remove git from help and use generic term(s) where needed.
* Use SortedOptParser from ansible.utils
* More abstraction of common options used between ansible and
  ansible-playbook.
11 years ago
Matt Lesko b37ecb055c set checkout destination directory to be full path
we chdir into this path and read the playbook/inventory if a
non-absolute path is given on the command line, that will fail
12 years ago
Michael DeHaan c2988dfdb0 Merge branch 'option-updates' of git://github.com/jlund/ansible into devel
Conflicts:
	bin/ansible-pull
12 years ago
Stavros Korokithakis 53207ddbdf Add --only-if-changed option. 12 years ago
Joshua Lund dc984d94ac Updates to Ansible command options
* Moved the --list-hosts option that is common to both `ansible` and
  `ansible-playbook` into utils/__init__.py (corrects a FIXME)
* Wrote new help text for the --list-hosts option that makes sense
  for both of the commands that it applies to
* Changed the usage argument in `ansible-playbook` so that it is
  setup in the base_parser method the same way that it is in
  the `ansible` executable
* Updated the help text for several options to correct typos,
  clarify meaning, improve readability, or fix grammatical errors.
  In the case of `ansible-pull`, I changed the help text so that
  it adheres to the same standards as the other executables.
12 years ago
Stephen Fromm 355ab6983c remove errant and unneeded import of ansible.constants 12 years ago
Stephen Fromm 291fb9e944 Help ansible-pull work better in bootstap environment
Add option to specify inventory.  No default is defined since
ansible-playbook already does this and it allows an ansible.cfg in the
git repository to take precedence.
Overall, this should help ansible-pull work with less setup in advance,
which should be helpful in kickstart scenarios.  Much of this was
discussed in issue #2464.
12 years ago
Stephen Fromm 4ae3bee416 Add --limit to calls to ansible and ansible-playbook
--limit takes localhost, FQDN, and 127.0.0.1.
12 years ago
Stephen Fromm 60d3e9f3de Add --purge option to ansible-pull
Removes git checkout after playbook run.
12 years ago
Stephen Fromm 034e8f59ed Clean up auto-selection of playbook and miscellaneous changes
Direct any ansible-pull specific messages to stderr.
Introduce try_playbook() and select_playbook() to remove try/except-y.
12 years ago
Matthew Johnson 0841ed4796 change method of obtaining hostname to match ansible/library/setup 12 years ago
Matthew Johnson 2b24131baa fetch the git repo before trying to find a playbook 12 years ago
Stephen Fromm 788e11f1db Merge commits from copperlight's branch ansible-pull_playbook_parameter branch
Merged commits: 3cd25b5 and ed9fc76.  Some massaging of changes applied.
12 years ago
Michael DeHaan faed4b5a33 whitespace + remove deprecated YAML parser (migration script lives in examples/scripts and warning was added
in 0.6 release)
12 years ago
Michael DeHaan a33320d03d Add some comments to ansible-pull and the example playbook 13 years ago
Stephen Fromm 84c9caa805 Simplify ansible-pull to just invoke ansible and ansible-playbook
This eliminates the creation of runner and playbook instances and just
invokes the processes ansible and ansible-playbook.
13 years ago
Stephen Fromm 672794f586 Add ansible-pull
A first stab at a pull-based model for ansible.  This does two things:
    1. Invoke the git module via Runner to set up a git repository on the
       localhost.  It sets up Runner to use transport='local' and forces
       the inventory to just 'localhost'.
    2. Run any playbooks provided.  By default, this wants to run the
       playbook local.yml.  This also sets transport='local' and sets
       the host_list to a list: localhost, fqdn, and hostname.
The reason for setting the host_list and not using override_hosts is
because there may be plays in the playbook that are not meant for a
specific host.  That is, if the git repository is for the entire site
and not host-specific, you don't want to override hosts and apply all
plays to any given host.  This has the downside of potentially running a
play three times if the play is defined for 'hosts: all'.
13 years ago