Commit graph

52 commits

Author SHA1 Message Date
Sam Doooran
8e022ef00a
import_playbook - change additional params to deprecation ()
* import_playbook - change additional params to deprecation

I incorrectly recommended this be set as a warning when it should have been a deprecation.

* Fix deprecation sanity test to not required a collection name when not inside a collection
2020-12-17 14:14:58 -05:00
Felix Fontein
da60525610
Fix missing ansible.builtin FQCNs in hardcoded action names ()
* Make sure hard-coded action names also check for FQCN.
* Use _add_internal_fqcn() to avoid hardcoded lists and typoes.
2020-11-03 08:51:31 -05:00
Matt Martz
e73a0b2460
Explicitly get the include task, and not assume it is the parent ()
* Explicitly get the include task, and not assume it is the parent. Fixes 
2020-10-29 15:15:18 -04:00
Matt Martz
7c60dadb9a
Updates to Integration tests to pass against Alpine ()
* Start of alpine testing

* More updates

* Add forgotten file

* remove debug

* Add alpine3

* equal

* group 4

* group 4

* group 5

* Try to decrease test length

* libuser only available in testing

* Remove debug

* Make loops target work on hosts without gnu date

* Enable alpine testing

* ci_complete

* Don't specify uid for creating test user

* ci_complete

* Re-sort docker completion

* use newer container image

* ci_complete

* fix indentation

Co-authored-by: Matt Clay <matt@mystile.com>

Co-authored-by: Matt Clay <matt@mystile.com>
2020-08-07 14:28:10 -05:00
Matt Martz
4e27569347
Add more include and yaml parsing tests ()
These additional tests should provide coverage for features currently tested by the postgres incidental tests.
2020-08-04 11:24:52 -07:00
Sam Doran
b2d6db7916
Rebalance CI groups to avoid macOS timeouts () 2020-06-19 16:40:51 -04:00
Kshitij Chawla
32c392e622
Raise Warning when import_playbook receives additional parameters ()
* Extra whitespace around imported playbook filename are stripped.
* Corrected call for display.deprecated
* Changed warning type & added test
* Added auto verification of raised warning
* More accurate warning message
2020-06-10 13:22:40 -04:00
Martin Krizek
9645304da3
Validate args for includes in handlers too () 2020-05-12 09:35:58 +02:00
Abhijeet Kasurde
3591451bc7
include_role: Strictly check string datatype for *_from ()
Strictly check string datatype for 'tasks_from', 'vars_from',
'defaults_from', and 'handlers_from' in include_role

Fixes: 

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-04-17 10:57:41 +05:30
Vasili
9b28f1f5d9
Fix incorrect "Could not match supplied host pattern" warning () () 2020-02-14 15:50:52 -06:00
Yanis Guenane
4fd2dce7f3
Testing: Add support for AIX platform () 2020-01-29 15:56:51 -08:00
Abhijeet Kasurde
683c467609
Check if task file is specified for import_tasks ()
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2019-12-24 10:26:32 +05:30
Kiyo Nagamine
daecbb9bf0 Ensure allow_duplicates: true enables to run single role multiple times () ()
* Ensure `allow_duplicates: true` enables to run single role multiple times()

* Changed return value in `_load_roles` . Fixes 

* Add changelog fragment

* Add an integration test for the issue

* Fix changelog generation error and integration test.

* Fix yaml syntax error in changelog fragment
2019-12-03 10:21:54 -05:00
Sam Doran
c485a1b91e
Fix sanity tests based on newer version of shellcheck ()
- change egrep to grep -E
- store exit codes and check them directly
- ignore SC1091
2019-08-12 16:24:28 -04:00
Matt Clay
233efe0886 Add missing boilerplate. 2019-08-06 15:45:22 -07:00
Matt Martz
923e21836b
Move plugin loader playbook dir additions back to Playbook instead of PlaybookCLI ()
* Move plugin loader playbook dir additions back to Playbook instead of PlaybookCLI. Fixes 

* Restore cli additions
2019-08-06 15:58:15 -05:00
Martin Krizek
e8948f7655
Actually run valid_include_keywords test () 2019-06-11 18:21:28 +02:00
Matt Martz
576593e175
Whitelist listen as a valid keyword on TaskInclude ()
* Whitelist listen as a valid keyword on TaskInclude. Fixes 

* Move 'listen' to HandlerTaskInclude

* Remove trailing newline
2019-05-17 12:52:39 -05:00
Will Thames
cd95843ea5 Make ansible adhoc work with include_role ()
* Make ansible adhoc work with include_role

Fix logic condition so that include_role works
without

```
ERROR! 'async_val' is not a valid attribute for a IncludeRole

The error appears to be in 'None': line 0, column 0, but may
be elsewhere in the file depending on the exact syntax problem.

(could not open file to display line)
```

* Add include_role test for adhoc
2019-05-08 09:53:24 -04:00
Matt Martz
fbf2d5d2f4
Don't pollute include_variables ()
* Don't pollute include_variables. Fixes . Fixes .

* Rename include_variables to include_args, so we can make the distinction about what they are

* Track args and vars separately

* oops

* oops again

* linting fix

* Add test
2019-04-09 10:14:42 -05:00
Matt Clay
8aa4b037ce Fix include_import test.
This will allow the test to work when HOST_PATTERN_MISMATCH is set to error.
2019-03-21 20:08:27 -07:00
René Moser
c5609c51bf
include_tasks: fix traceback if no file specified () 2019-03-20 19:17:20 +01: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
828e8d4957 Move include_import test inventory into test. 2019-01-09 19:09:33 -08:00
Matt Martz
3b49bbcfde Give IncludedFile more context via ansible_search_path ()
* Give IncludedFile more context via ansible_search_path to template lookups. Fixes 

* Update units
2019-01-03 16:13:02 -05:00
Matt Martz
77befcf5d7
Do not allow addressing an import from handlers via notify. Fixes () 2018-11-29 13:50:07 -06:00
Jimmy McCrory
d2969884b4 Add run_once as a valid TaskInclude keyword ()
* Add run_once as a valid TaskInclude keyword

* Add changelog fragment

* Add integration test that documents run_once behavior
2018-11-08 10:29:24 -05:00
Matt Martz
d5e4f37ca0
Ensure we don't overwrite roles from include/import_role when loading the play ()
* Ensure we don't overwrite roles from include/import_role when loading the play. Fixes 

* Add changelog fragment
2018-10-23 11:08:48 -05:00
Matt Martz
a06a5ded61
Do not use mutable defaults in FieldAttribute, instead allow supplying a callable for defaults of mutable types. Fixes () 2018-10-12 10:43:09 -05:00
Matt Martz
0015d4cef3
2.8 Core Deprecation Removal ()
* Remove deprecated ansible.vars.unsafe_proxy. Fixes 

* Remove deprecated validate_md5 alias from fetch module. Fixes 

* Remove deprecated private arg from import/include_role. Fixes 

* All include deprecations bumped to 2.12. Fixes 

* Add changelog for deprecated removals
2018-09-10 15:05:52 -05:00
Matt Martz
2a4e92aab7
ensure if we get a non-Task object in _get_delegated_vars, we return early () 2018-08-30 17:11:32 -05:00
Matt Martz
a0d7d4b82f Change insertion order of apply block to not affect the include_X task itself () 2018-08-30 16:56:28 -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
27b4d7ed31
Add feature to expose vars/defaults with include/import_role ()
* First pass at making 'private' work on include_role, imports are always public

* Prevent dupe task execution and overwriting handlers

* New functionality will use public instead of deprecated private

* Add tests for public exposure

* Validate vars before import/include to ensure they don't expose too early

* Add porting guide docs about public argument and change to import_role

* Add additional docs about public and vars exposure to module docs

* Insert role handlers at parse time, exposing them globally
2018-07-15 09:59:30 -05:00
Matt Martz
50905b980d Support item label in v2_playbook_on_include ()
* Support item label in v2_playbook_on_include. Fixes 

* test fixes
2018-07-09 11:27:00 -04:00
Matt Martz
76867730bf
Don't ignore a duplicate host for an already processed include ()
* Don't ignore a duplicate host for an already processed include, assume that the repetition indicates a new include. Fixes 

* Add intg tests to ensure duplicate items in loop are not deduped

* Add note about relative indexing
2018-06-08 15:36:22 -05:00
Matt Martz
c403f01971
Revert , improve error messaging ()
* Revert " Update TaskInclude _raw_params with the expanded/templated path to file ()"

This reverts commit 4b01b92cfe.

* Improve error messaging, catch error templating parent path
2018-06-07 09:00:50 -05:00
Matt Martz
da4ff18406
Support 'apply' to apply attributes to included tasks - Impl 1 ()
* Support 'apply' to apply attributes to included tasks

* Cannot validate args for task_include

* Only allow apply on include_

* Re-enable arg validation, but only for include_tasks and import_tasks

* s/task/ir/

* Add tests for include_ apply

* Include context with AnsibleParserError

* Add docs for apply

* version_added

* Add free-form documentation back

* Add example of free-form with apply
2018-05-31 12:08:38 -05:00
Matt Martz
3d5a7d6dc2
Allow using action/local_action on includes and imports ()
* Prevent using action/local_action on includes and imports. Fixes 

* Use ModuleArgsParser to determine action instead of disallowing action/local_action with import/include

* Add to_native

* switch back to block in task_ds, use ModuleArgsParse otherwise

* var should be task_ds

* Add test validating action+include_tasks
2018-05-04 11:10:50 -05:00
Matt Martz
aeecdbfc35
Restore previous test play, break new tests into a new play () 2018-05-03 13:50:21 -05:00
Sam Doran
f872b70449 Remove skipping of never tag since it is done automatically () 2018-05-03 14:56:42 +10:00
Matt Martz
cca96b8c9d
Pass vars from import_playbook in early ()
* Pass vars from import_playbook in early, as they may be needed to parse the imported plays. Fixes 

* Add test for import_playbook vars
2018-04-30 16:13:43 -05:00
Matt Martz
240b060c02
Use the computed role name instead of 'role'. Fixes () 2018-04-30 14:41:13 -05:00
Matt Martz
7db5ce2c86
Ensure handlers have proper parent ()
* Ensure role handlers are parented correctly. Fixes 

* Add delegate_to test for include_role handlers
2018-04-27 12:03:57 -05:00
Matt Martz
4b01b92cfe
Update TaskInclude _raw_params with the expanded/templated path to file ()
* Update TaskInclude _raw_params with the expanded/templated path to file

* Add tests to validate host vars include paths
2018-04-26 14:25:02 -05:00
Matt Martz
2f5161628a
Don't skip conditional exception on includes ()
* task_executor.py: Raise 'conditional exception' in case of 'include_*'

Fixes 

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

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

* Remove unnecessary conditional
2018-04-26 13:39:44 -05:00
Matt Martz
354aa8d602
Skip self._parent on dynamic, defer to grandparent for attr lookup ()
* Skip self._parent on dynamic, defer to grandparent for attr lookup

* Revert _inheritable

* Add tests for include inheritance from static blocks

Fixes  
2018-04-16 16:46:47 -05:00
Sam Doran
e5776a129a Add include_import tests for many top level include_tasks ()
* 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
2018-04-11 17:08:33 -04:00
Sam Doran
00068e9fcc
Add integration tests for include_role using variable for tasks_file ()
* Add tests using a variable in tasks_from field

Related to 

* Do not test using hostvars with import_role

hostvars cannot be used with import_role — use include_role instead
2018-03-23 15:43:00 -04:00
Im0
8c4f349743 Test include role with items in name ()
* Tests for 

* Tests for 

* Tests for 
2018-03-20 15:39:16 -05:00