mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00: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:
@@ -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 = """
|
||||
|
||||
Reference in New Issue
Block a user