From 171c95672ea91f5e61ed1e1a20e2b912c3ec198b Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Sun, 19 Jul 2015 23:16:54 -0400 Subject: [PATCH] fixed gathering expression as it was triggering when gather_facts was no --- lib/ansible/executor/play_iterator.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/ansible/executor/play_iterator.py b/lib/ansible/executor/play_iterator.py index 8deeac8b4dd..c886b46f2a7 100644 --- a/lib/ansible/executor/play_iterator.py +++ b/lib/ansible/executor/play_iterator.py @@ -139,10 +139,11 @@ class PlayIterator: # NOT explicitly set gather_facts to False. gathering = C.DEFAULT_GATHERING - if ((gathering == 'smart' and not host._gathered_facts) or - (gathering == 'explicit' and boolean(self._play.gather_facts)) or - (gathering == 'implicit' and - (self._play.gather_facts is None or boolean(self._play.gather_facts)))): + implied = self._play.gather_facts is None or boolean(self._play.gather_facts) + + if (gathering == 'implicit' and implied) or \ + (gathering == 'explicit' and boolean(self._play.gather_facts)) or \ + (gathering == 'smart' and implied and not host._gathered_facts): if not peek: # mark the host as having gathered facts host.set_gathered_facts(True)