Commit Graph

58 Commits (0f882d010fda19c9bc591a3eb0b6ded6249886c3)

Author SHA1 Message Date
Matt Martz 4b01b92cfe
Update TaskInclude _raw_params with the expanded/templated path to file (#39365)
* Update TaskInclude _raw_params with the expanded/templated path to file

* Add tests to validate host vars include paths
6 years ago
Matt Martz 2f5161628a
Don't skip conditional exception on includes (#39377)
* task_executor.py: Raise 'conditional exception' in case of 'include_*'

Fixes #33632

Signed-off-by: Patrick Ringl <patrick_@freenet.de>

* Re-organize tests, add static include test with undefined var

* Remove unnecessary conditional
6 years ago
Matt Martz 354aa8d602
Skip self._parent on dynamic, defer to grandparent for attr lookup (#38827)
* Skip self._parent on dynamic, defer to grandparent for attr lookup

* Revert _inheritable

* Add tests for include inheritance from static blocks

Fixes #38037 #36194
6 years ago
Sam Doran e5776a129a Add include_import tests for many top level include_tasks (#36531)
* Add include_import tests for many top level include_tasks

Rename a few test playbooks to make more sense

* Use fewer include_tasks due to memory limits in CI
6 years ago
Sam Doran 00068e9fcc
Add integration tests for include_role using variable for tasks_file (#37742)
* Add tests using a variable in tasks_from field

Related to #32503

* Do not test using hostvars with import_role

hostvars cannot be used with import_role — use include_role instead
6 years ago
Im0 8c4f349743 Test include role with items in name #36372 (#37001)
* Tests for #36372

* Tests for #36372

* Tests for #36372
6 years ago
kiorky 9001a8794f FIX: multiple nested tasks include levels (#35165)
* Test for include_tasks & include_role bug

Related to ansible/ansible:#21890

* Fix nested include_tasks called from role

This fixes the path of included files when you want
to call include_task inside a role's task file and this
role is itself called from multiple level of playbook include_tasks

Related to ansible/ansible:#21890
This fixes ansible/ansible:#35109
7 years ago
Sam Doran 10a8c6bc25 Integration tests for import/include (#33418)
* First pass at include_role tests

* Reorganize test structure

Do all import and include tests in a single target.

* Build out more tests and test with linear and free strategy for each type

* import_role tests

* Set target host for play test

* Basic import_playbook tests

* Basic import/include_tasks tests

* Add recursion test

* import_playbook tests

* Add import_playbook group_vars test

Issue #33177

* Additional group_var tests for import_playbook

* Enable recursion test

* More work on import_tasks

* Run all tests via run.sh, improve conditional tests, add never tag

Add never tag to certain failining tests and explicitly skip it for now until #34104 is merged. Some tasks need to remain commented out because they cause the entire play to fail and aren't skippable by tags because they are syntax and/or variable checks.

Improve test for whether or not a role was run based on a conditional. Since the [import|include]_role does not register a variable, use a variable that is set inside a role as a canary test for whether or not the role was run.

* Use a fail task rather than trigger a failure via bogus command

This should resolve the "unstable" test results.

* Import tag tests

Fix bug it tests where validate tasks weren't run on tag tests.
Add tests for task import/include with tags.

* Remove test for playbook group_var inheritance
7 years ago