summaryrefslogtreecommitdiff
path: root/bin/ansible-playbook
diff options
context:
space:
mode:
Diffstat (limited to 'bin/ansible-playbook')
-rwxr-xr-xbin/ansible-playbook26
1 files changed, 4 insertions, 22 deletions
diff --git a/bin/ansible-playbook b/bin/ansible-playbook
index a3b2958179..2a692a2e3d 100755
--- a/bin/ansible-playbook
+++ b/bin/ansible-playbook
@@ -227,22 +227,6 @@ def main(args):
label = play.name
hosts = pb.inventory.list_hosts(play.hosts)
- # Filter all tasks by given tags
- if pb.only_tags != 'all':
- if options.subset and not hosts:
- continue
- matched_tags, unmatched_tags = play.compare_tags(pb.only_tags)
-
- # Remove skipped tasks
- matched_tags = matched_tags - set(pb.skip_tags)
-
- unmatched_tags.discard('all')
- unknown_tags = ((set(pb.only_tags) | set(pb.skip_tags)) -
- (matched_tags | unmatched_tags))
-
- if unknown_tags:
- continue
-
if options.listhosts:
print ' play #%d (%s): host count=%d' % (playnum, label, len(hosts))
for host in hosts:
@@ -251,12 +235,10 @@ def main(args):
if options.listtasks:
print ' play #%d (%s):' % (playnum, label)
- for task in play.tasks():
- if (set(task.tags).intersection(pb.only_tags) and not
- set(task.tags).intersection(pb.skip_tags)):
- if getattr(task, 'name', None) is not None:
- # meta tasks have no names
- print ' %s' % task.name
+ for task in pb.tasks_to_run_in_play(play):
+ if getattr(task, 'name', None) is not None:
+ # meta tasks have no names
+ print ' %s' % task.name
if options.listhosts or options.listtasks:
print ''
continue