From 04a6dc6d12802a3d5de28a00773c5e4be794a1d2 Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Sat, 8 Mar 2014 14:02:42 -0600 Subject: [PATCH] Check for skipped tags in passed role variables before adding to them Fixes #6330 --- lib/ansible/playbook/play.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/ansible/playbook/play.py b/lib/ansible/playbook/play.py index 08564ba57e2..198f15d061b 100644 --- a/lib/ansible/playbook/play.py +++ b/lib/ansible/playbook/play.py @@ -227,6 +227,13 @@ class Play(object): if meta_data: allow_dupes = utils.boolean(meta_data.get('allow_duplicates','')) + if "tags" in passed_vars: + if not self._is_valid_tag(passed_vars["tags"]): + # one of the tags specified for this role was in the + # skip list, or we're limiting the tags and it didn't + # match one, so we just skip it completely + continue + # if any tags were specified as role/dep variables, merge # them into the passed_vars so they're passed on to any # further dependencies too, and so we only have one place @@ -268,13 +275,6 @@ class Play(object): if 'role' in dep_vars: del dep_vars['role'] - if "tags" in passed_vars: - if not self._is_valid_tag(passed_vars["tags"]): - # one of the tags specified for this role was in the - # skip list, or we're limiting the tags and it didn't - # match one, so we just skip it completely - continue - if not allow_dupes: if dep in self.included_roles: # skip back to the top, since we don't want to