mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-26 12:21:26 -07:00
Support 'apply' to apply attributes to included tasks - Impl 1 (#39236)
* 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
This commit is contained in:
parent
961484e00d
commit
da4ff18406
9 changed files with 175 additions and 4 deletions
|
@ -26,6 +26,10 @@ description:
|
|||
- This module is also supported for Windows targets.
|
||||
version_added: "2.2"
|
||||
options:
|
||||
apply:
|
||||
description:
|
||||
- Accepts a hash of task keywords (e.g. C(tags), C(become)) that will be applied to the tasks within the include.
|
||||
version_added: '2.7'
|
||||
name:
|
||||
description:
|
||||
- The name of the role to be executed.
|
||||
|
@ -89,6 +93,15 @@ EXAMPLES = """
|
|||
include_role:
|
||||
name: myrole
|
||||
when: not idontwanttorun
|
||||
|
||||
- name: Apply tags to tasks within included file
|
||||
include_role:
|
||||
name: install
|
||||
apply:
|
||||
tags:
|
||||
- install
|
||||
tags:
|
||||
- always
|
||||
"""
|
||||
|
||||
RETURN = """
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue