From 4457985062362fb687a670dbf9df88e6977f7eae Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Fri, 2 Sep 2016 08:53:50 -0400 Subject: [PATCH] added ability to use pure boolean in conditionals --- lib/ansible/playbook/conditional.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/ansible/playbook/conditional.py b/lib/ansible/playbook/conditional.py index 5615a252b8..14f50f8829 100644 --- a/lib/ansible/playbook/conditional.py +++ b/lib/ansible/playbook/conditional.py @@ -64,6 +64,10 @@ class Conditional: ds = getattr(self, '_ds') try: + # this allows for direct boolean assignments to conditionals "when: False" + if isinstance(self.when, bool): + return self.when + for conditional in self.when: if not self._check_conditional(conditional, templar, all_vars): return False