Commit graph

7542 commits

Author SHA1 Message Date
Brian Coca
1139d61d59 simplified logic paths 2016-08-26 11:39:12 -04:00
Patrik Lundin
b4f338bca7 Add OpenBSD virtualization facts. (#17227)
* Add OpenBSD virtualization facts.

Patch written by @jasperla.

Tested by various people on:
- virtualbox
- vmware esx(i) + fusion
- kvm (smartos + plain linux + a random cloud provider)

This patch is already present in the OpenBSD port of ansible.

* Rework diff to get rid of extra returns.

Requested by @bcoca.

While here, use four-space indentations of all code blocks.

* Set facts even if no match is found.

Discussed with @bcoca.

* Find sysctl via get_bin_path().

Requested by @bcoca.

* Fail if we do not find a sysctl binary.

* Do not fail if a sysctl binary is not found.

Just set empty fact values instead.
Requested by @bcoca.
2016-08-26 11:27:41 -04:00
Abhijit Menon-Sen
b4a035718e Make _display_plugin_load much less noisy
There was general consensus that displaying every plugin load on -vvv
was *way* too noisy. This commit reformats the log message to be less
verbose, and drops it down to debugging-only level.
2016-08-26 20:28:58 +05:30
Alexander Stock
238cccf166 Fix "Text file busy" exception in atomic_move (#9526) (#17204)
tempfile.NamedTemporaryFile keeps a file handle causing os.rename() to fail with windows based vboxfs: [Errno 26] Text file busy.
Changed NamedTemporaryFile to mkstemp() and added a finally block to unlink the temp file in each and every case.
2016-08-26 07:41:17 -07:00
Michael Scherer
a942758a07 Fix wrong error class (#17259)
AnsibleError is not imported in that file, and since that's
a parsing time issue, better raise AnsibleParserError like the
rest of the file.

Issue signaled on irc by gordon`
2016-08-26 08:53:28 -04:00
Toshio Kuratomi
4a3a9c0f2d Fix for run_command on py3 and enable lineinfile test on py3 (#17257)
* run_command needed a bit of tweaking to its string handling of
  arguments.
* The run_command change fixes the last bit of lineinfile so we can
  enable its tests
2016-08-26 01:30:46 -07:00
Toshio Kuratomi
9ac20e231d Update core submodule to pull in lineinfile py3 fix 2016-08-26 01:07:00 -07:00
Toshio Kuratomi
f57f33a8e7 Fix fetch idempotence (#17255)
Fetch always follows symlinks when downloading so it needs to always
follow symlinks when getting the checksum of the file as well.
2016-08-25 21:45:38 -07:00
Peter Sprygada
fb9b98a543 Merge pull request #17254 from privateip/netcli
adds new property command_string to Command object
2016-08-25 22:51:02 -04:00
Peter Sprygada
9f1ac47f70 adds new property command_string to Command object
This adds a new property to the Command object that is used to hold
modified command strings that could be different from the command used
to create the object.  This allows for seamless switch between text and
json enabled commands.
2016-08-25 22:11:37 -04:00
Peter Sprygada
5036bba2e0 implements command_string property when preparing commands
* commands that need | json added now use command_string property
* adds additonal keyword args in exception handling for json commands
2016-08-25 22:11:23 -04:00
James Cammarata
e375bfd6a5 Use post_validated play for serial calculations in TQM
Fixes #17185
2016-08-25 17:50:22 -05:00
Toshio Kuratomi
0a39700b36 Fix octal output in a few more places (#17250)
Fix filetree lookup plugin for python3 (octal output and selinux API
takes native strings)
2016-08-25 14:58:35 -07:00
Toshio Kuratomi
2dd5e13098 Update submodule refs 2016-08-25 11:04:26 -07:00
Toshio Kuratomi
bd68c324ce Get the ssh plugin working with python3 (#17234) 2016-08-25 10:57:55 -07:00
Chris Faulkner
dbab23e68f Fix context_demo callback plugin. (#17235) 2016-08-25 10:22:27 -07:00
Yann Autissier
8fd3935029 Fix get_distribution for Alpine Linux (#17224)
To override a generic class that is subclassed based on platform, the
subclass must define platform and distribution.

The load_platform_subclass() calls the get_platform() and
get_distribution() methods to detect the platform and the distribution.

On Alpine Linux, get_distribution() method returns None and it is not
possible to have different implementations based on detected platform.
2016-08-25 10:18:42 -07:00
Abhijit Menon-Sen
3ab9dddb3a Make the extract filter return Undefined on KeyError
groups['x']|map('extract', hostvars, 'somevar') would break if any host
didn't have 'somevar' set. With this change, it will return Undefined
instead. This change permits |map('extract', …)|map('default', 42) to
set a default value in such cases.
2016-08-25 22:45:20 +05:30
Peter Sprygada
24e8e3b03f initial add of shared modules for supporting Nokia SROS devices
This adds a cli transport, netcfg, and netcli implementations for working
with devices running Nokia SROS.  There is also an update to netcfg
to support the sros config file format.
2016-08-25 11:47:00 -04:00
Matt Clay
178292d2cd Fix file and copy modules on py3 and enable tests. (#17239)
- Fix octal formatting of file mode in module response on py3.
- Convert file path to unicode in copy action.
- Enable file and copy module tests for py3 now that they pass.
2016-08-25 07:44:31 -07:00
Toshio Kuratomi
44d979c8f5 Enable most unittests on python3 (just some vault unittests and a logging one left) (#17240)
Make some python3 fixes to make the unittests pass:

* galaxy imports
* dictionary iteration in role requirements
* swap_stdout helper for unittests
* Normalize to text string in a facts.py function
2016-08-25 07:30:03 -07:00
Abhijit Menon-Sen
1a62fe3874 Merge pull request #13739 from chrrrles/ipaddr_empty_string
ipaddr filter properly handle addresses on /31 networks
2016-08-25 15:47:08 +05:30
Peter Sprygada
c7924ab04e Merge pull request #17231 from privateip/ios
update ios doc fragments
2016-08-24 19:04:49 -04:00
Peter Sprygada
09eda7e206 update ios doc fragments
removes invalid shared arguments from fragment
2016-08-24 17:06:10 -04:00
Toshio Kuratomi
7b4f808a21 One more izip_longest => zip_longest fix (#17229) 2016-08-24 13:50:14 -07:00
Toshio Kuratomi
51ec35378d xrange and izip_longest aren't available in vanilla python3 (#17226)
Fixes for these are either rewriting to get rid of the need for the
functions or using six.moves to get equivalent functions for both
python2 and python3
2016-08-24 12:28:02 -07:00
Yannig
27b0f3241b new filter human_bytes: convert a string (ex: 1Mo, 1K) into bytes (#12074)
* Rework human_readable and human_to_bytes.
New filter human_to_bytes.

* Fix for python 3.
2016-08-24 12:04:20 -07:00
Ansible Test Runner
733f977ad2 Update submodule refs for more python3 fixes 2016-08-24 11:51:36 -07:00
Nathaniel Case
b70e49e749 Relicense module_utils/asa.py (#17223) 2016-08-24 14:44:17 -04:00
Toshio Kuratomi
89f91b1cd7 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 13:57:35 -04:00
Toshio Kuratomi
5d865ec1ef Cleanup debug.py (#17222)
* Use isinstance instead of comparing to type.
* Change check against unicode type to check against six.string_types
  for python3 compatibility.
2016-08-24 10:37:15 -07:00
Nathaniel Case
8ac5896889 Provide options for SSH key checking (#15736)
* Provide options for SSH key checking
2016-08-24 13:29:10 -04:00
Peter Sprygada
8f79ea9b1d Merge pull request #17188 from Qalthos/asa_module
Update module_utils/asa.py with NetworkModule
2016-08-24 13:04:40 -04:00
Toshio Kuratomi
300d6482d1 Hashing needs byte strings in python3 (#17221)
First try at porting this passed in string-types as that worked on
python2.  Python3 is more strict so be explicit about converting from
text to bytes
2016-08-24 09:29:59 -07:00
Toshio Kuratomi
e098c5ef82 Update submodule refs 2016-08-24 08:41:51 -07:00
Peter Sprygada
ce6de1f64d Merge pull request #17220 from privateip/iosxr
updates iosxr shared module
2016-08-24 11:39:44 -04:00
Peter Sprygada
fa0d39a1b4 updates iosxr shared module
This completes the refactor of the iosxr 2.2 shared module.  It also
includes the iosxr_config action plugin to be implemented by the
iosxr_config module for 2.2
2016-08-24 11:03:01 -04:00
Chris Houseknecht
f717786949 Merge pull request #17202 from chouseknecht/devel
Local variable *choices* referenced before assignment
2016-08-24 10:57:49 -04:00
Toshio Kuratomi
040a38171a Clean up task_executor for python3 (#17219)
ran task_executor through python-modernize and then made changes to the
code pointed out by it:

* Most places where we looped through dict.keys() changed to
      for key in dict:
  Using keys() in python2 creates a list() of keys.  For iterating, we
  can iterate over the dict itself and we'll be handed back each key.
  In python3, doing it this way does not create a new list and thus is
  more memory efficient.
* In one place, use:
      for key in list(dict.keys()):
  because we're deleting elements from the dictionary inside of the
  loop.  So we really do need to iterate over a separate list of the
  keys to avoid modifying the dictionary that we're iterating over.
  (Fixes Python3 bug)
* In one place, change the order of an if-elif-else tree so that the
  most frequent cases are evaluated first. (Optimization)
2016-08-24 07:52:36 -07:00
Peter Sprygada
90ef5bf4a6 updates vyos shared module and moves functions into vyos_config
This update moves many of the functions into the vyos_config
module to conform with the network 2.2 refactor.  This also
fixes the load_config method
2016-08-24 10:17:31 -04:00
Toshio Kuratomi
72cda8ffd7 Update submodule refs 2016-08-24 06:42:57 -07:00
Toshio Kuratomi
58b9f637a1 Workaround for Ubuntu Python3 looking for modules in wrong places (#17211)
* Workaround for Ubuntu Python3 looking for modules in wrong places

* More exact ubuntu version numbers
2016-08-24 00:43:50 -07:00
nitzmahone
a9322e8b8b py3-friendly multi-exception fix for missing fileno under debugger 2016-08-23 19:55:39 -07:00
Adrian Likins
e396d5d508 Implement vault encrypted yaml variables. (#16274)
Make !vault-encrypted create a AnsibleVaultUnicode
yaml object that can be used as a regular string object.

This allows a playbook to include a encrypted vault
blob for the value of a yaml variable. A 'secret_password'
variable can have it's value encrypted instead of having
to vault encrypt an entire vars file.

Add __ENCRYPTED__ to the vault yaml types so
template.Template can treat it similar
to __UNSAFE__ flags.

vault.VaultLib api changes:
    - Split VaultLib.encrypt to encrypt and encrypt_bytestring

    - VaultLib.encrypt() previously accepted the plaintext data
      as either a byte string or a unicode string.
      Doing the right thing based on the input type would fail
      on py3 if given a arg of type 'bytes'. To simplify the
      API, vaultlib.encrypt() now assumes input plaintext is a
      py2 unicode or py3 str. It will encode to utf-8 then call
      the new encrypt_bytestring(). The new methods are less
      ambiguous.

    - moved VaultLib.is_encrypted logic to vault module scope
      and split to is_encrypted() and is_encrypted_file().

Add a test/unit/mock/yaml_helper.py
It has some helpers for testing parsing/yaml

Integration tests added as roles test_vault and test_vault_embedded
2016-08-23 20:03:11 -04:00
nitzmahone
dbf7df4439 fix pycharm debugger issue on missing fileno
Under pycharm debugger, stdin has no fileno, but throws AttributeError instead of ValueError. Account for both.
2016-08-23 17:00:14 -07:00
Peter Sprygada
2a61fa0e79 Merge pull request #17200 from privateip/netcfg
removes invoke method from Config class
2016-08-23 17:08:29 -04:00
chouseknecht
fdb5ecd7d1
Fixes 'choices referenced before assignment' error on line #287. 2016-08-23 16:21:26 -04:00
Toshio Kuratomi
a22909c226 Migrate basestring to a python3 compatible type (#17199) 2016-08-23 13:13:44 -07:00
Peter Sprygada
af05a13854 removes invoke method from Config class
this removes the invoke method which was lingering from before
we separated netcfg into its own module
2016-08-23 15:35:01 -04:00
Yannig
92c6283e93 Add speed link in gathered facts for Linux. (#15347) 2016-08-23 13:09:16 -04:00
Adrian Likins
8bbbe16d31 try/except xmltodict import, misc cleanups (#16287)
The 'import xmltodict' was causing import
errors when generating documentation. Since
xmltodict is a required but not stdlib module,
throw AnsibleError if unable to import.

Remove unused combine_vars.

Replace a use of 'stdin_iterator == None' with
idiomatic 'stdin_iterat is None'

Misc pep8 cleanups.
2016-08-23 13:07:25 -04:00
Adrian Likins
71118b2720 Show where plugins were loaded in vvv/vvvv (#15757)
Make the plugin loading info displayed by callback plugins
match.

In debug mode (ANSIBLE_DEBUG=1 env), log all requests for
plugins including already cached plugins and class_only
requests.
2016-08-23 11:54:14 -04:00
Nathaniel Case
f5ff3e3add Remove abort_config and commit_config
Also move unimplemented command methods to CliBase, where they can be overridden
as needed
2016-08-23 11:24:48 -04:00
Toshio Kuratomi
76f9935634 Add some missing imports from last night's py3 fixes (#17196) 2016-08-23 08:06:20 -07:00
Adrian Likins
0b070a04d0 Fix docstring for GenericBsdIfconfogNetwork. (#17008)
default_ipv4/default_ipv6 and type/mtu/network
were listed as not defined, but they are usually
defined now.
2016-08-23 11:05:09 -04:00
Toshio Kuratomi
f4f84639bb Update submodule refs 2016-08-23 06:39:30 -07:00
Michael Scherer
b2476e7d99 Fix errors when using -vvvv with python 3 (#17186)
Traceback (most recent call last):
      File "/tmp/ansible_tpehdgt7/ansible_module_setup.py", line 134, in <module>
        main()
      File "/tmp/ansible_tpehdgt7/ansible_module_setup.py", line 124, in main
        supports_check_mode = True,
      File "/tmp/ansible_tpehdgt7/ansible_modlib.zip/ansible/module_utils/basic.py", line 696, in __init__
      File "/tmp/ansible_tpehdgt7/ansible_modlib.zip/ansible/module_utils/basic.py", line 1670, in _log_invocation
      File "/tmp/ansible_tpehdgt7/ansible_modlib.zip/ansible/module_utils/basic.py", line 469, in heuristic_log_sanitize
    TypeError: 'str' does not support the buffer interface
2016-08-23 06:38:04 -07:00
Marius Gedminas
73caff58e8 Add missing to_unicode import 2016-08-23 09:24:02 +03:00
Marius Gedminas
483c83b088 There's no ansible.module_utils_unicode 2016-08-23 09:22:03 +03:00
Toshio Kuratomi
313d4b2c9e Move a path being passed around as a byte string to being passed around as a text string. (#17190)
This is enough to get minimal copy module working on python3

We have t omodify dataloader's path_dwim_relative_stack and everything
that calls it to use text paths instead of byte string paths
2016-08-22 21:55:30 -07:00
Peter Sprygada
20bde8f549 Merge pull request #17189 from privateip/eos
updates eos shared module
2016-08-22 20:52:18 -04:00
Peter Sprygada
b5bbac29e5 updates eos shared module
* adds support for netcli methods
* adds support for netcfg methods
* Cli class now derives from CliBase
* adds eos_config action plugin
2016-08-22 20:26:16 -04:00
Toshio Kuratomi
57701d7115 Give native strings to selinux library functions. (#17184)
* Give native strings to selinux library functions.

SELinux takes pathnames as native strings.  That means we need to
convert to bytes on python2 and convert to text on python3.

Fixes #17155

* Read kitchen documentation, make module_utils params more like kitchen API

* Remove none nonstring strategy and add strict
* Raise TypeError on invalid nonstring strategy

* Document to_native()

* Make unittests for testing module_utils.text
2016-08-22 16:44:13 -07:00
Nathaniel Case
a35296a42d Common CliBase run_commands implementation 2016-08-22 18:11:56 -04:00
Nathaniel Case
f4a6fa1747 Rewrite asa.py for NetworkModule 2016-08-22 18:11:52 -04:00
Toshio Kuratomi
384a01fcff Fix tmpfile misspelled as tmplfile (#17183) 2016-08-22 11:31:42 -07:00
Adrian Likins
a4785c2691 Fix docker connection plugin version tests and py2.6 compat (#16841)
* Rm py2.7+ code in docker connection plugin

The docker connection plugin was using subprocess.check_output
which only exists in python 2.7 and later. Connection plugins
need to support python2.6 so this replaces it with Popen/communicate()

* Handle docker ver errors in docker connection

Add unit tests for DockerConnection

Fixes #16971
2016-08-22 10:39:38 -04:00
Peter Sprygada
7ce4165671 Merge pull request #17173 from privateip/ios
minor update to the ios shared module
2016-08-22 10:35:27 -04:00
Peter Sprygada
301495ddcc Merge pull request #17172 from privateip/nxos
updates nxos shared module refactor
2016-08-22 10:35:17 -04:00
Brian Coca
54c530a3ee more ways to detect lxc
thanks to @wAmpire for new method and pointing out limitations of existing
2016-08-22 08:45:36 -04:00
Peter Sprygada
1015f11428 minor update to the ios shared module
This completes the refactor for the ios shared module to change
the derived class from NetCli to CliBase.
2016-08-21 08:59:59 -04:00
Peter Sprygada
4ab4b6698d updates nxos shared module refactor
This commit updates the nxos transport shared plugins for
2.2.  This includes updates to both Cli and Nxapi.  This commit
also includes the nxos_config action plugin
2016-08-21 08:57:49 -04:00
Peter Sprygada
321d2e8cee Merge pull request #17168 from privateip/clibase
replaces NetCli in network with CliBase in shell
2016-08-20 17:29:53 -04:00
Peter Sprygada
044a0533db replaces NetCli in network with CliBase in shell
This doesn't change any of the behavior but moves NetCli to CliBase and
relcates the object to the shell module
2016-08-20 13:55:07 -04:00
Toshio Kuratomi
171a094805 Cleanup basic.py code now that six is available (#17158)
* Cleanup basic.py code now that six is available

We had some hacks in basic.py to allow us python2 and python3
compatibility.  Those can now be offloaded to the six library that we're
bundling.

* Cleanup basic.py code now that six is available

We had some hacks in basic.py to allow us python2 and python3
compatibility.  Those can now be offloaded to the six library that we're
bundling.
2016-08-20 08:08:59 -07:00
Peter Sprygada
959a5e5fd1 Merge pull request #17166 from privateip/ios
fix import statement in ios shared module
2016-08-20 09:30:06 -04:00
Peter Sprygada
388f98437e Merge pull request #17165 from privateip/network
fix broken import statement from netcli rename
2016-08-20 09:29:55 -04:00
Peter Sprygada
53abcb23fa rename netcmd module to netcli
This is part of the 2.2 refactor to extract the Cli class into a
separate module.  This renames netcmd to netcli which is consistent
with the network shared modules implementations
2016-08-20 08:45:53 -04:00
Peter Sprygada
7cb2c31b1a fix import statement in ios shared module
This fixes the import statement when netcmd was renamed to netcli
2016-08-20 08:22:13 -04:00
Peter Sprygada
ac8b8f0b8b fix broken import statement from netcli rename
The network module needed to be updated with the correct module name
when netcmd was renamed to netcli
2016-08-20 08:19:08 -04:00
Peter Sprygada
f53dbec55a removes Cli and Config objects from network into separate modules
This completes the refactor of Cli and Config moving them into separate
modules netcmd and netcfg respectively.
2016-08-20 07:57:39 -04:00
Peter Sprygada
24c6443557 removes functions from ios module
This removes top level functions from the ios module and moves them
into the specific modules.  This update also includes some clean up
of the Cli transport
2016-08-20 07:27:47 -04:00
Peter Sprygada
90747e6d2f Merge pull request #17161 from privateip/netcmd
moves Cli and Command class from network to netcmd module
2016-08-20 07:25:08 -04:00
Peter Sprygada
7c928e878b moves Cli and Command class from network to netcmd module
This restructure moves the Cli object to netcmd and includes a roll up
of inor bugfix updates to CommandRunner

* CommandRunner now only allows one instance of a command in the stack and
  raise an exception if a duplidate command is detected
* CommandRunner now caches returns based on command and output
* CommandRunner is not responsible for creating Command instances
2016-08-20 06:57:13 -04:00
Adrian Likins
7d41f623dd Move py34 mock_open compat to compat/test/mock (#17157)
test/units/plugins/action/test_action.py had code
for handling a bug in python 3.4's mock_open that
causes errors when reading binary data.

Moved to compat/tests/mock.py so other tests can
use it by default.
2016-08-19 18:11:24 -04:00
Peter Sprygada
fa395bee7b Merge pull request #17149 from privateip/plugin-net-config
action plugin net_config will now remove any private result key
2016-08-19 11:48:00 -04:00
Peter Sprygada
d50ef4446f action plugin net_config will now remove any private result key
This update will now remove any keys from results that are created using
the private names.  Private names are identified as double underscore (__)
on either side of the key name
2016-08-19 11:15:36 -04:00
Peter Sprygada
112f14866a pull Config object out of network and into netcfg
This moves the Config class from network and into netcfg module with
no added features.  This is simply a reorganization of code.
2016-08-19 11:15:01 -04:00
Dusty Mabe
b817f1f3ea actions/unarchive: fix unarchive from remote url (#17126)
* actions/unarchive: fix unarchive from remote url

Currently unarchive from remote url does not work because the core
unarchive module was updated to support 'remote_src' [1], but the
unarchive action plugin was not updated for this. This causes failures
because the action plugin assumes it needs to copy a file to the
remote server, but in the case of downloading a file from a remote
url a local file does not exist, so an error occurs when the file is
not found.

[1] https://github.com/ansible/ansible-modules-core/commit/467516e

* test_unarchive: fix test with wrong remote_src use

The non-ascii filenames test had improperly set remote_src=yes even
though it was actually copying the file from the local machine (i.e.
the file did not already exist remotely). This test was passing
until the remote_src behavior of unarchive was fixed in 276550f.
2016-08-19 08:16:21 -05:00
James Cammarata
890e096b2b 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
2016-08-18 13:52:34 -05:00
Toshio Kuratomi
cb3653295f Update submodule refs 2016-08-18 07:28:03 -07:00
Brian Coca
4fb09d5693 moved from extras repo where it incorrectly exists (#17124)
* moved from extras repo where it incorrectly exists

* added to sanity exclusion for 2.4

* changed license with author's consent
2016-08-18 09:47:21 -04:00
Toshio Kuratomi
bd31cc096a Fix facts.py for python3 (#17131)
* Fix facts.py for python3

* Update facts unittest to account for filepaths being byte strings
2016-08-18 09:36:03 -04:00
Adrian Likins
7bd57acda4 Linux mount/fs (lsblk) facts fixes and tests. (#17036)
Fixes #10779

Refactor some of the block device, mount point, and
mtab/fstab facts collection for linux for better
performance on systems with lots of block devices.

Instead of invoking 'lsblk' for every entry in mtab,
invoke it once, then map the results to mtab entries.

Change the args used for invoking 'findmnt' since the
previous combination of args conflicts, so this would
always fail on some systems depending on version.

Add test cases for facts Hardware()/Network()/Virtual() classes
__new__ method and verify they create the proper subclass based
on the platform.system() results.

Split out all the 'invoke some command and grab it's output'
bits related to linux mount paths into their own methods so
it is easier to mock them in unit tests.

Fix the DragonFly* classes that did not defined a 'platform'
class attribute. This caused FreeBSD systems to potentially
get the DragonFly* subclasses incorrectly. In practice it
didnt matter much since the DragonFly* subclasses duplicated
the FreeBSD ones. Actual DragonFly systems would end up with
the generic Hardware() etc instead of the DragonFly* classes.

Fix Hardware.__new__() on PY3, passing args to __new__
would cause "object() takes no parameters" errors. So
check for PY3 and just call __new__ without the args

See
https://hg.python.org/cpython/file/44ed0cd3dc6d/Objects/typeobject.c#l2818
for some explaination.
2016-08-17 17:58:51 -07:00
nitzmahone
9fedcdfc47 bump extras submodule ref 2016-08-17 16:42:37 -07:00
nitzmahone
88c36bbc34 bump submodule refs 2016-08-17 15:52:26 -07:00
James Cammarata
b617d62203 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
2016-08-17 16:28:48 -05:00
James Cammarata
732d722a7f Catch a missing include_vars filename
Related to ansible/ansible-modules-core#4445
2016-08-17 09:35:37 -05:00
Matt Davis
e0bdb502e3 raw now returns changed: true (#17112)
for consistency w/ shell/command/script "non-idempotent" modules.

Updated tests, changelog.
2016-08-16 20:39:23 -07:00
James Cammarata
f4237b2151 Rework the way params are assigned to TaskIncludes when they're dynamic
Copying the TaskInclude task (which is the parent) before loading the blocks
makes the code much more simple and clean, and fixes a bug introduced during
the performance improvement changes (and specifically the change which moved
things to a single-parent model).

Fixes #17064
2016-08-16 15:45:24 -05:00