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:
Matt Martz 2018-05-31 12:08:38 -05:00 committed by GitHub
parent 961484e00d
commit da4ff18406
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 175 additions and 4 deletions

View file

@ -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 = """