mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
make --list-tasks honor --limit
This commit is contained in:
parent
b6c4ec0713
commit
b7df767065
1 changed files with 3 additions and 1 deletions
|
@ -149,12 +149,14 @@ def main(args):
|
||||||
playnum += 1
|
playnum += 1
|
||||||
play = ansible.playbook.Play(pb, play_ds, play_basedir)
|
play = ansible.playbook.Play(pb, play_ds, play_basedir)
|
||||||
label = play.name
|
label = play.name
|
||||||
|
hosts = pb.inventory.list_hosts(play.hosts)
|
||||||
if options.listhosts:
|
if options.listhosts:
|
||||||
hosts = pb.inventory.list_hosts(play.hosts)
|
|
||||||
print ' play #%d (%s): host count=%d' % (playnum, label, len(hosts))
|
print ' play #%d (%s): host count=%d' % (playnum, label, len(hosts))
|
||||||
for host in hosts:
|
for host in hosts:
|
||||||
print ' %s' % host
|
print ' %s' % host
|
||||||
if options.listtasks:
|
if options.listtasks:
|
||||||
|
if options.subset and not hosts:
|
||||||
|
continue
|
||||||
matched_tags, unmatched_tags = play.compare_tags(pb.only_tags)
|
matched_tags, unmatched_tags = play.compare_tags(pb.only_tags)
|
||||||
unmatched_tags.discard('all')
|
unmatched_tags.discard('all')
|
||||||
unknown_tags = set(pb.only_tags) - (matched_tags | unmatched_tags)
|
unknown_tags = set(pb.only_tags) - (matched_tags | unmatched_tags)
|
||||||
|
|
Loading…
Reference in a new issue