1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-07-08 19:49:09 +00:00

Whitelist listen as a valid keyword on TaskInclude (#56586)

* Whitelist listen as a valid keyword on TaskInclude. Fixes #56580

* Move 'listen' to HandlerTaskInclude

* Remove trailing newline
This commit is contained in:
Matt Martz 2019-05-17 12:52:39 -05:00 committed by GitHub
parent b5935486da
commit 576593e175
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 55 additions and 1 deletions

View file

@ -26,6 +26,8 @@ from ansible.playbook.task_include import TaskInclude
class HandlerTaskInclude(Handler, TaskInclude):
VALID_INCLUDE_KEYWORDS = frozenset(('listen',) + tuple(TaskInclude.VALID_INCLUDE_KEYWORDS))
@staticmethod
def load(data, block=None, role=None, task_include=None, variable_manager=None, loader=None):
t = HandlerTaskInclude(block=block, role=role, task_include=task_include)

View file

@ -82,7 +82,7 @@ class TaskInclude(Task):
def preprocess_data(self, ds):
ds = super(TaskInclude, self).preprocess_data(ds)
diff = set(ds.keys()).difference(TaskInclude.VALID_INCLUDE_KEYWORDS)
diff = set(ds.keys()).difference(self.VALID_INCLUDE_KEYWORDS)
for k in diff:
# This check doesn't handle ``include`` as we have no idea at this point if it is static or not
if ds[k] is not Sentinel and ds['action'] in ('include_tasks', 'include_role'):