Commit graph

19500 commits

Author SHA1 Message Date
James Cammarata
f80c981ef6 Clean up PlaybookExecutor logic for batches and errors
The calculation for max_fail_percentage was moved into the linear
strategy a while back, and works better there in the stategy layer
rather than at the PBE layer. This patch removes it from the PBE layer
and tweaks the logic controlling whether or not the next batch is run.

Fixes #15954

(cherry picked from commit 890e096b2b)
2016-08-25 12:28:08 -05:00
Ansible Test Runner
fc3efdb057 Changelog entry for https://github.com/ansible/ansible/pull/17225 2016-08-24 11:04:10 -07:00
Toshio Kuratomi
7d6df50e0e The former match for a section header included hosts that began with a range. (#17225)
Checking that the line ends with "]" narrows that window somewhat,

Fixes #15331
2016-08-24 10:59:32 -07:00
James Cammarata
b2fe1b39df New release v2.1.2.0-0.1.rc1 2016-08-22 16:15:56 -05:00
Toshio Kuratomi
719c73afa2 Fix tmpfile misspelled as tmplfile (#17183) 2016-08-22 11:32:40 -07:00
James Cammarata
bf929ac532 Backport of f722d41 to the stable-2.1 branch
Related to #15915
2016-08-22 10:21:45 -05:00
nitzmahone
9478e41394 bump extras submodule ref for another win_chocolatey fix 2016-08-17 16:41:00 -07:00
nitzmahone
29dd1635fe bump submodule refs 2016-08-17 15:51:09 -07:00
James Cammarata
ea7a038f6f Don't use an unset playbook basedir when searching for hostgroup vars
The flag new_pb_basedir is not being utilized in Inventory._get_hostgroup_vars,
leading to the situation where an inventory with no playbook basedir set will
read host/group vars from the $CWD, regardless of the inventory and/or playbook
relative location. This patch corrects that by not using the playbook basedir
if it is unset (None).

This patch also corrects a bug in which the VariableManager would accumulate
host/group vars files, which could lead to incorrect vars files being used when
playbooks are run from different directories containing their own group/host vars
directories.

Fixes #16953

(cherry picked from commit b617d62203)
2016-08-17 16:29:13 -05:00
Brian Coca
cf0eb42ad5 fixed tests to accoutn for new parameter
(cherry picked from commit b1410fa278)
2016-08-17 10:58:49 -04:00
James Cammarata
77fe1ac7af Catch a missing filename in include_vars
Fixes ansible/ansible-modules-core#4445
2016-08-17 09:30:14 -05:00
Nathaniel Case
8312df1512 Relicense netcfg.py to BSD (#17110)
As with #17025. The caveat regarding machilde's (now obsoleted) commit has been addressed, so netcfg.py is able to be easily relicensed.
2016-08-16 16:35:07 -04:00
Brian Coca
2de8d2ece7 make parsed param private and explicit (#17104)
* make parsed param private and explicit

* fixed missed parsed

(cherry picked from commit 5fe9d3c3d5)
2016-08-16 11:59:47 -04:00
David Shrewsbury
d35377dac7 Fix async logic when parsing fails (#17091)
We want to NOT consider the async task as failed if the result is
not parsed, which was the intent of:

  https://github.com/ansible/ansible/pull/16458

However, the logic doesn't actually do that because we default
the 'parsed' value to True. It should default to False so that
we continue waiting, as intended.
(cherry picked from commit bf8c871801)
2016-08-15 13:37:26 -04:00
Brian Coca
616a51ac00 updated submodule refs 2016-08-12 10:48:24 -04:00
Jim Ladd
3749d44cd5 Increase local version for unofficial rpms (#17045) 2016-08-11 17:36:37 -07:00
nitzmahone
1601e24593 bump core submodule ref to pick up reverted unarchive change 2016-08-11 12:29:30 -07:00
nitzmahone
69d66727ca update core submodule ref 2016-08-11 11:29:01 -07:00
Nathaniel Case
6fe13bbb47 Relicense low-hanging fruit to BSD (#17025) 2016-08-10 10:49:27 -07:00
Toshio Kuratomi
e71cce7776 Add sync: poll fix to changelog 2016-08-08 11:16:59 -07:00
Toshio Kuratomi
f695dd6892 Fix from @jimi-c to use task_vars when polling async tasks. (#17003)
This is needed so that async_status can use ansible_python_interpreter
for the host being contacted.

Fixes #14101
(cherry picked from commit 38ccd11cce)
2016-08-08 11:07:32 -07:00
Brian Coca
9255a618e3 set cwd to task's basedir (#16805)
* switch cwd to basedir of task

This restores previous behaviour in pre 2.0 and allows for 'local type' plugins
and actions to have a more predictable relative path.

fixes #14489

* removed FIXME since prev commit 'fixes' this

* fix tests, now they need a loader (thanks jimi!)

(cherry picked from commit e2f17f8d9b)
2016-08-08 13:14:00 -04:00
Matt Clay
cf9ef724e9 Use file list, not recursion, in _fixup_perms. (#16924)
Run setfacl/chown/chmod on each temp dir and file.

This fixes temp file permissions handling on platforms such as FreeBSD
which always return success when using find -exec. This is done by
eliminating the use of find when setting up temp files and directories.

(cherry picked from commit 72cca01cd4)
2016-08-05 18:50:31 -07:00
James Cammarata
f956ff9619 Tweak the way the debug strategy imports the linear strategy parent
Due to the way we load plugins, internally to Python there can be issues when
the debug strategy is loaded after the linear strategy. To work around this,
we're changing the import line for the linear strategy to avoid the problem.

Related to #16825

(cherry picked from commit 1714279b5e)
2016-08-05 10:08:38 -05:00
Toshio Kuratomi
0000b76a0a YAML treats some unquoted strings as booleans. For instance, (#16961)
uri:
    follow_redirects: no

Will lead yaml to set follow_redirects=False.  This is problematic when
the module parameter is not a boolean value but a string.  For instance:

  follow_redirects = dict(required=False, default='safe', choices=['all', 'safe', 'none', 'yes', 'no']),

Our parameter validation code ends up getting follow_redirects="False"
instead of "no".  The 100% fix is for the user to quote their strings in
playbooks like:
  uri:
    follow_redirects: "no"

But we can fix quite a few common cases by trying to switch "False" back
into the string that it was specified as.  We only do this if there is
only one correct choices value that could have been specified.  In the
follow_redirects example, a value of "True" only maps back to "yes" and
a value of "False" only maps back to "no" so we can do this.  If choices
also contained "on" and "off" then we couldn't map back safely and would
need to force the module author to change the module to handle this
case.

Fixes parts of the following PRs:

* https://github.com/ansible/ansible-modules-core/pull/4220
* https://github.com/ansible/ansible-modules-extras/pull/2593
(cherry picked from commit 6db6edfc4f)
2016-08-05 06:51:18 -07:00
Toshio Kuratomi
7bd9128848 * Fix race in creating temp directories pre-fork (#16965)
* These can still race when multiple ansible processes are created at
    the same time.
* Reverse order of expanduser and expandvars in unfrakpath(). So that
  tildes in environment variables will be handled.
(cherry picked from commit 1ecf51d87e)
2016-08-04 16:43:22 -07:00
Toshio Kuratomi
9f645cdbdb Add the PID of the Ansible process to local_tmp directory. (#16589)
This aids in associating a leftover cachedir with a previous run of
Ansible.  Came about because of #16489
(cherry picked from commit 3f4027f7b4)
2016-08-04 16:40:40 -07:00
Matt Davis
baaa1d3013 fix for unspecified retries on until + test (#16963)
fixes #16907
(cherry picked from commit 746ea64d30)
2016-08-04 19:31:49 -04:00
ovcharenko
e464237894 Fix for issue @synchronize doesn't substitute variables properly #16347 (#16349)
* Fix for issue @synchronize doesn't substitute variables properly #16347
2016-08-04 11:30:43 -07:00
victoru
08ae111757 raise AnsibleError in hashi_vault lookup plugin when hvac module is not installed (#16859)
(cherry picked from commit 14901b65d9)
2016-08-04 10:06:42 -07:00
Brian Coca
df16e37ad7 Implicit localhost ondemand (#16900)
* Revert "There can be only one localhost"

This reverts commit 5f1bbb4fcd.
this broke several usages of localhost, see #16882, #16898 and #16886

* ensure there is only 1 localhost

fixes #16886, #16882 and #16898

- make sure localhost exists before returning it
- optimzed host caching
- ensure we always return a host object

(cherry picked from commit f7570f1dc4)
2016-08-02 10:39:37 -04:00
Lukas Pirl
db4e661fef (re)allow ansible_python_interpreter to contain more than 1 arg (#16247) 2016-07-28 13:55:02 -07:00
Andrew Gaffney
167a12003d Fix quoting of args for old-style modules
This removes the extra layer of quotes around values in the 'args' file.
These quotes were there before the pipes.quote() call was added, but
were not removed, resulting in too much quoting.
2016-07-28 13:55:02 -07:00
elotje
3b6b4f6ce4 Unprivileged become on HP-UX/UNIX (Fixes #16249) (#16275)
Problem: When setting the file permissions on the remote server for
unprivileged users ansible expects that a chown will fail for unprivileged
users. For some systems (e.g. HP-UX) this is not the case.

Solution: Change the order how ansible sets the remote permissions.
* If the remote_user sudo's to an unprivileged user then we attempt to
  grant the unprivileged user access via file system acls.
* If granting file system acls fails we try to change the owner of the
  file with chown which only works in case the remote_user is privileged
  or the remote systems allows chown calls by unprivileged users (e.g.
  HP-UX)
* If the chown fails we can set the file to be world readable so that
  the second unprivileged user can read the file. Since this could allow
  other users to get access to private information we only do this
  ansible is configured with "allow_world_readable_tmpfiles" in the
  ansible.cfg
2016-07-28 13:55:02 -07:00
James Cammarata
780c363482 New release v2.1.1.0-1 2016-07-28 10:32:34 -07:00
James Cammarata
32b6114bef Updating CHANGELOG for 2.1.1 2016-07-28 10:17:27 -07:00
James Cammarata
02389d6c51 New release v2.1.1.0-0.5.rc5 2016-07-24 18:06:49 -05:00
Alex Mirski-Fitton
044547034d Make returning results after loading vars optional
Reinstates some functionality removed by commit 0ba9a6a but
makes the expensive operation optional (and default to off)

(cherry picked from commit 7dc09adaf4)
2016-07-24 11:51:57 -05:00
James Cammarata
6ca9b406ec New release v2.1.1.0-0.4.rc4 2016-07-23 16:59:25 -04:00
nitzmahone
3ec6e95e47 bump core submodule ref 2016-07-22 10:00:02 -07:00
Toshio Kuratomi
53c348c89d Only show the traceback for importing cryptography when in Ansible Debug. (#16795) 2016-07-22 05:41:45 -07:00
Toshio Kuratomi
3e964dbfae Update submodules 2016-07-21 11:11:44 -07:00
Connor Osborn
505a1de605 Fix exceptions thrown from cryptography import (#16723)
A simple import of cryptography can throw several types of errors. For example,
if `setuptools` is less than cryptography's minimum requirement of 11.3, then
this import of cryptography will throw a VersionConflict here. An earlier case
threw a DistributionNotFound exception.

An optional dependency should not stop ansible. If the error is more than
an ImportError, log a warning, so that errors can be fixed in ansible or
elsewhere.
2016-07-21 05:30:42 -07:00
James Cammarata
ed959d72f1 Fix bug where getting role vars does not follow the dep chain
This bug was introduced in 3ced6d3, where getting vars from a role
did not follow the dep chain. This was originally hidden by the fact
that we got vars twice (from the block and from the roles directly).

Fixes #16729

(cherry picked from commit d8a3feb976)
2016-07-19 17:02:01 -04:00
James Cammarata
35da6ba9d1 New release v2.1.1.0-0.3.rc3 2016-07-18 16:12:07 -04:00
Toshio Kuratomi
cf6f46683a Update submodule ref 2016-07-15 06:48:15 -07:00
jctanner
b7479a1dc6 Add a function to check for killed processes in all strategies (#16684)
* Add a function to check for killed processes so that if any
threads are sigkilled or sigtermed, the entire playbook execution is aborted.

(cherry picked from commit 238c6461f6)
2016-07-14 17:31:09 -04:00
Adrian Likins
fb6e58e888 Update submodule refs 2016-07-14 15:20:54 -04:00
Toshio Kuratomi
87dcec9fc5 Update submodule refs 2016-07-13 10:34:52 -07:00
James Cammarata
137385059c Fixing type in 293723f (mock_handler -> mock_handler_task) 2016-07-12 16:59:30 -05:00