summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMartin Krizek <martin.krizek@gmail.com>2023-02-16 16:30:23 +0100
committerGitHub <noreply@github.com>2023-02-16 09:30:23 -0600
commit02d9336b320c39de652667069b7ecadd8ed36fc9 (patch)
treea187aee039a048dd8438687f8aa09ac27f94bc29 /lib
parenta082726ef28c3d6763259aa42d9c1191e2a0f77e (diff)
downloadansible-02d9336b320c39de652667069b7ecadd8ed36fc9.tar.gz
Make using blocks as handlers a parser error (#79993) (#80010)
Fixes #79968 (cherry picked from commit bd329dc54329a126056723311abd7442ed6a0389)
Diffstat (limited to 'lib')
-rw-r--r--lib/ansible/playbook/helpers.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/ansible/playbook/helpers.py b/lib/ansible/playbook/helpers.py
index 444f571e99..38e32ef9a2 100644
--- a/lib/ansible/playbook/helpers.py
+++ b/lib/ansible/playbook/helpers.py
@@ -106,6 +106,8 @@ def load_list_of_tasks(ds, play, block=None, role=None, task_include=None, use_h
raise AnsibleAssertionError('The ds (%s) should be a dict but was a %s' % (ds, type(ds)))
if 'block' in task_ds:
+ if use_handlers:
+ raise AnsibleParserError("Using a block as a handler is not supported.", obj=task_ds)
t = Block.load(
task_ds,
play=play,