diff options
author | James Cammarata <jimi@sngx.net> | 2018-01-23 15:29:37 -0600 |
---|---|---|
committer | Toshio Kuratomi <a.badger@gmail.com> | 2018-01-23 19:46:26 -0800 |
commit | a21f44dc0a2334439e0424497c16c96d702956a6 (patch) | |
tree | 67e4162729ace22e132ef981c9798d5da190a9a7 | |
parent | 055cae3c0f1f4c5ec16de3fdfbc10d0356d391da (diff) | |
download | ansible-a21f44dc0a2334439e0424497c16c96d702956a6.tar.gz |
Restore the behavior of 2.4 to that before ebf971f9
Fixes #35065
-rw-r--r-- | lib/ansible/playbook/block.py | 2 | ||||
-rw-r--r-- | lib/ansible/playbook/task.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/ansible/playbook/block.py b/lib/ansible/playbook/block.py index 3d6f7016e1..da51e1447e 100644 --- a/lib/ansible/playbook/block.py +++ b/lib/ansible/playbook/block.py @@ -291,7 +291,7 @@ class Block(Base, Become, Conditional, Taggable): value = self._attributes[attr] if self._parent and (value is None or extend): try: - if getattr(self._parent, 'statically_loaded', True): + if attr != 'when' or getattr(self._parent, 'statically_loaded', True): if hasattr(self._parent, '_get_parent_attribute'): parent_value = self._parent._get_parent_attribute(attr) else: diff --git a/lib/ansible/playbook/task.py b/lib/ansible/playbook/task.py index 93af5950c8..a9ea487e8a 100644 --- a/lib/ansible/playbook/task.py +++ b/lib/ansible/playbook/task.py @@ -413,7 +413,7 @@ class Task(Base, Conditional, Taggable, Become): try: value = self._attributes[attr] if self._parent and (value is None or extend): - if getattr(self._parent, 'statically_loaded', True): + if attr != 'when' or getattr(self._parent, 'statically_loaded', True): # vars are always inheritable, other attributes might not be for the partent but still should be for other ancestors if attr != 'vars' and getattr(self._parent, '_inheritable', True) and hasattr(self._parent, '_get_parent_attribute'): parent_value = self._parent._get_parent_attribute(attr) |