Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- block.py 2022-11-05 22:36:42.946474359 +0300
- +++ block.py 2022-11-05 23:34:29.554474359 +0300
- @@ -376,8 +376,8 @@
- if filtered_block.has_tasks():
- tmp_list.append(filtered_block)
- elif (task.action in C._ACTION_META or
- - (task.action in C._ACTION_INCLUDE and task.evaluate_tags([], self._play.skip_tags, all_vars=all_vars)) or
- - task.evaluate_tags(self._play.only_tags, self._play.skip_tags, all_vars=all_vars)):
- + (task.action in C._ACTION_INCLUDE and task.evaluate_tags([], self._play.skip_tags, all_vars=all_vars, set_tags=self._play.set_tags, unset_tags=self._play.unset_tags)) or
- + task.evaluate_tags(self._play.only_tags, self._play.skip_tags, all_vars=all_vars, set_tags=self._play.set_tags, unset_tags=self._play.unset_tags)):
- tmp_list.append(task)
- return tmp_list
- --- taggable.py 2022-11-05 22:34:58.022474359 +0300
- +++ taggable.py 2022-11-05 23:25:42.634474359 +0300
- @@ -30,6 +30,10 @@
- untagged = frozenset(['untagged'])
- _tags = FieldAttribute(isa='list', default=list, listof=(string_types, int), extend=True)
- + # Tags mechanism
- + _set_tags = FieldAttribute(isa='list', default=list, listof=(string_types, int), extend=True)
- + _unset_tags = FieldAttribute(isa='list', default=list, listof=(string_types, int), extend=True)
- +
- def _load_tags(self, attr, ds):
- if isinstance(ds, list):
- return ds
- @@ -42,7 +46,7 @@
- else:
- raise AnsibleError('tags must be specified as a list', obj=ds)
- - def evaluate_tags(self, only_tags, skip_tags, all_vars):
- + def evaluate_tags(self, only_tags, skip_tags, all_vars, set_tags=frozenset(), unset_tags=frozenset()):
- ''' this checks if the current item should be executed depending on tag options '''
- if self.tags:
- @@ -63,6 +67,10 @@
- should_run = True # default, tasks to run
- + # Houston, process the static!
- + only_tags.update(set_tags)
- + skip_tags.update(unset_tags)
- +
- if only_tags:
- if 'always' in tags:
- should_run = True
Advertisement
Add Comment
Please, Sign In to add comment