summaryrefslogtreecommitdiff
path: root/lib/ansible/playbook/block.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ansible/playbook/block.py')
-rw-r--r--lib/ansible/playbook/block.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/ansible/playbook/block.py b/lib/ansible/playbook/block.py
index 4324a77ef5..3571aa4802 100644
--- a/lib/ansible/playbook/block.py
+++ b/lib/ansible/playbook/block.py
@@ -19,6 +19,7 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
+import ansible.constants as C
from ansible.errors import AnsibleParserError
from ansible.playbook.attribute import FieldAttribute
from ansible.playbook.base import Base
@@ -374,8 +375,8 @@ class Block(Base, Conditional, CollectionSearch, Taggable):
filtered_block = evaluate_block(task)
if filtered_block.has_tasks():
tmp_list.append(filtered_block)
- elif (task.action == 'meta' or
- (task.action == 'include' and task.evaluate_tags([], self._play.skip_tags, all_vars=all_vars)) or
+ elif (task.action in C._ACTION_META or
+ (task.action in C._ACTION_INCLUDE and task.evaluate_tags([], self._play.skip_tags, all_vars=all_vars)) or
task.evaluate_tags(self._play.only_tags, self._play.skip_tags, all_vars=all_vars)):
tmp_list.append(task)
return tmp_list