Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 04a6dc6

Browse files
committed
Check for skipped tags in passed role variables before adding to them
Fixes ansible#6330
1 parent c79b5ea commit 04a6dc6

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

lib/ansible/playbook/play.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,13 @@ def _build_role_dependencies(self, roles, dep_stack, passed_vars={}, level=0):
227227
if meta_data:
228228
allow_dupes = utils.boolean(meta_data.get('allow_duplicates',''))
229229

230+
if "tags" in passed_vars:
231+
if not self._is_valid_tag(passed_vars["tags"]):
232+
# one of the tags specified for this role was in the
233+
# skip list, or we're limiting the tags and it didn't
234+
# match one, so we just skip it completely
235+
continue
236+
230237
# if any tags were specified as role/dep variables, merge
231238
# them into the passed_vars so they're passed on to any
232239
# further dependencies too, and so we only have one place
@@ -268,13 +275,6 @@ def __merge_tags(var_obj):
268275
if 'role' in dep_vars:
269276
del dep_vars['role']
270277

271-
if "tags" in passed_vars:
272-
if not self._is_valid_tag(passed_vars["tags"]):
273-
# one of the tags specified for this role was in the
274-
# skip list, or we're limiting the tags and it didn't
275-
# match one, so we just skip it completely
276-
continue
277-
278278
if not allow_dupes:
279279
if dep in self.included_roles:
280280
# skip back to the top, since we don't want to

0 commit comments

Comments
 (0)