From 413fb15e0ad083800f793fd60f8bffa6eff3cdda Mon Sep 17 00:00:00 2001 From: Peter Sankauskas Date: Wed, 18 Jul 2012 15:31:04 -0700 Subject: [PATCH] Conditional Imports should only import the first file in the list, not all of them. This change stops looping through the vars_files list as soon as a file is found. --- lib/ansible/playbook/play.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ansible/playbook/play.py b/lib/ansible/playbook/play.py index 0a56e4b8f66..0fa459058d9 100644 --- a/lib/ansible/playbook/play.py +++ b/lib/ansible/playbook/play.py @@ -232,6 +232,8 @@ class Play(object): self.vars.update(data) elif host is not None: self.playbook.callbacks.on_not_import_for_host(host, filename4) + if found + break if not found: raise errors.AnsibleError( "%s: FATAL, no files matched for vars_files import sequence: %s" % (host, sequence)