Commit graph

27 commits

Author SHA1 Message Date
Brian Coca
b518aabf81
delegation fix ()
*  delegation fix
2021-05-24 10:13:19 -04:00
Brian Coca
aa4d53ccdf
ensure local exposes correct user ()
* ensure local exposes correct user

  avoid corner case in which delegation relied on
  playcontext fallback which was removed

  fixes 
2020-11-09 16:21:17 -05:00
Matt Martz
c4acd41d6e
Ensure delegate vars calculation has correct loop context. Fixes () 2020-10-12 14:21:15 -05:00
Sloane Hertel
cceba07114
VariableManager - add the 'vars' key before getting delegated variables ()
* VariableManager - add the 'vars' key before getting delegated variables
2020-10-02 15:13:56 -04:00
Brian Coca
84adaba6f5
Allow hostvars delegation ()
* ensure hostvars are available on delegation
* also inventory_hostname must point to current host and not delegated one
* fix get_connection since it was still mixing original host vars and delegated ones
* also return connection vars for delegation and non delegation alike
* add test to ensure we have expected usage when directly assigning for non delegated host
2020-07-22 11:13:57 -04:00
Sam Doran
a3c1ea886f
Revert commits related to delegated facts changes ()
* Revert "Fix storing delegate_to facts ()"

This reverts commit 88bb76f248.

* Revert "Fix storing local task_vars facts for the retry ()"

This reverts commit eaf6086eea.
2020-06-24 15:36:51 -04:00
Martin Krizek
88bb76f248
Fix storing delegate_to facts ()
* Fix storing delegate_to facts
2020-06-23 12:02:16 -04:00
Martin Krizek
eaf6086eea
Fix storing local task_vars facts for the retry ()
* Fix storing local task_vars facts for the retry

Fixes 
2020-06-22 10:07:47 -04:00
Brian Coca
4c9d9dbb56
fix discovery on loop with delegation ()
* fix discovery on loop with delegation

fixes 
2020-06-11 18:04:17 -04:00
Brian Coca
de3f7c7739
fix delegated interpreter discovery ()
* fix delegated interpeter
* allow returning fact if it is 'the right host'
* added note for future fix/efficiency
 as it stands we rerun discovery for the delegated host
unless its saving facts to itself
 * fixed test lacking delegate_to mock
2020-05-22 09:31:34 -04:00
Brian Coca
2165f9ac40
fix delegation vars usage (debug still shows inventory_hostname) ()
* fix delegation vars usage and reporting

 - just pass delegated host vars + task vars to plugins
   and avoid poluting with original host vars
 - updated tests
2020-05-14 16:36:13 -04:00
Yanis Guenane
4fd2dce7f3
Testing: Add support for AIX platform () 2020-01-29 15:56:51 -08:00
Matt Clay
07e9438848 Move interface management into delegate_to test. 2019-03-26 11:15:41 -07:00
Brian Coca
b793f08a92
fixes for stripping ()
function changed to do in place replacement, should be less expensive even with copy as it avoids 'sub copies', can compose with module_args_copy to create replacement for old behavior

  attempt to fix 

* handle lists and subdicts correctly
* added  missing exception case, which was not noticed since 'cleaning' was not working
* added comments to clarify exceptions
2019-03-12 18:18:38 -04:00
Matt Clay
1143889f26 Fix integration test inventory. 2019-03-12 00:00:32 -07:00
Matt Clay
759e037edc Fix integration tests with custom inventory.
All inventory hosts to which a connection is actually established
should declare ansible_python_interpreter to avoid interpreter
auto-discovery, as that may select the wrong interpreter.
2019-03-11 21:43:58 -07:00
Matt Clay
e5094e8071
Cleanup integration test inventory. ()
* Move var_blending test inventory into test.
* Remove Amazon specific inventory entry for tests.
* Remove Azure specific inventory entry for tests.
* Move var_precedence test inventory into test.
* Move unicode test inventory into test.
* Remove unused inventory entry.
* Move gathering_facts test inventory into test.
* Move delegate_to test inventory into test.
* Clean up inventory for binary_modules test.
* Clean up integration test inventory.
2019-01-10 14:45:12 -08:00
Matt Martz
77d32b8f57
Don't use the task for a cache, return a special cache var ()
* Don't use task to cache loop results, use hostvars. Fixes 

* Avoid a race condition, supply _ansible_loop_cache through get_vars directly

* Add tests

* Add changelog fragment

* Remove unnecessary copy

* Remove unnecessary host from _get_delegated_vars signature
2018-10-18 15:25:43 -05:00
Brian Coca
8743e6ae2e remove default from delegate_facts to inherit ()
* remove default from delegate_facts to inherit

fixes 

* test delegate_facts

* added note about inheritance and defaults

* yamllint
2018-10-10 15:10:23 -04:00
Matt Martz
9d89e15ff0
Ensure we only cache the loop when the task had a loop ()
* Further restrict caching of loop when the task actually had a loop. Fixes 

* Extend tests for loop caching
2018-08-30 12:02:43 -05:00
Brian Coca
cdc762dd9e
don't assume all delegation subkeys exist ()
* don't assume all delegation subkeys exist

fixes 

* add tests
2018-07-24 08:54:58 -04:00
Matt Clay
4e489d1be8
Update Shippable integration test groups. ()
* Update Shippable integration test groups.
* Update integration test group aliases.
* Rebalance AWS and Azure tests with extra group.
* Rebalance Windows tests with another group.
2018-07-23 20:46:22 -07:00
Matt Martz
1401fa74cc
Cache items when task.loop/with_items is evaluated to set delegate_to vars ()
* If we evaluate task.loop/with_items when calculating delegate_to vars, cache the items. Fixes 

* Add comments about caching loop items

* Add test for delegate_to+loop+random

* Be more careful about where we update task.loop
2018-06-26 15:10:04 -05:00
Martin Krizek
5c7f203c33
Add test for fix using loop_control with delegate_to () 2018-01-23 17:52:23 +01:00
Matt Clay
c26a556929 Add check for known_hosts changing during tests. ()
* Add check for known_hosts changing during tests.
* Don't use known hosts file for delegate_to test.
2017-07-06 00:47:28 -07:00
Matt Clay
6bbd92e422 Initial ansible-test implementation. () 2016-11-29 21:21:53 -08:00
Matt Clay
80a5c70ad7 Split integration tests out from Makefile. () 2016-10-12 14:57:53 -07:00