From 2fe25f19dc5d41ab60adb4a3258f4364c224bb5c Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Mon, 22 Jul 2013 10:11:19 -0400 Subject: [PATCH] Fix to group_by module as a result of previous conditional upgrades. --- lib/ansible/runner/action_plugins/group_by.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/ansible/runner/action_plugins/group_by.py b/lib/ansible/runner/action_plugins/group_by.py index 79bcea42c19..477f46fe844 100644 --- a/lib/ansible/runner/action_plugins/group_by.py +++ b/lib/ansible/runner/action_plugins/group_by.py @@ -58,8 +58,12 @@ class ActionModule(object): data = {} data.update(inject) data.update(inject['hostvars'][host]) - if not check_conditional(self.runner.basedir, self.runner.conditional, data, fail_on_undefined=self.runner.error_on_undefined_vars): - continue + conds = self.runner.conditional + if type(conds) != list: + conds = [ conds ] + for cond in conds: + if not check_conditional(cond, self.runner.basedir, data, fail_on_undefined=self.runner.error_on_undefined_vars): + continue group_name = template.template(self.runner.basedir, args['key'], data) group_name = group_name.replace(' ','-') if group_name not in groups: