summaryrefslogtreecommitdiff
path: root/bin/ansible-playbook
diff options
context:
space:
mode:
authortrbs <trbs@trbs.net>2014-02-06 15:49:06 +0100
committertrbs <trbs@trbs.net>2014-02-06 15:49:06 +0100
commitb7df76706591c5116afbd4fe0e74a5333acc10df (patch)
tree46d6e9352518bd42210c068675e93595d3fafb22 /bin/ansible-playbook
parentb6c4ec07133dfdf29c64298e7b76d642f7e52b8c (diff)
downloadansible-b7df76706591c5116afbd4fe0e74a5333acc10df.tar.gz
make --list-tasks honor --limit
Diffstat (limited to 'bin/ansible-playbook')
-rwxr-xr-xbin/ansible-playbook4
1 files changed, 3 insertions, 1 deletions
diff --git a/bin/ansible-playbook b/bin/ansible-playbook
index 0659a0e8a6..2241d75716 100755
--- a/bin/ansible-playbook
+++ b/bin/ansible-playbook
@@ -149,12 +149,14 @@ def main(args):
playnum += 1
play = ansible.playbook.Play(pb, play_ds, play_basedir)
label = play.name
+ hosts = pb.inventory.list_hosts(play.hosts)
if options.listhosts:
- hosts = pb.inventory.list_hosts(play.hosts)
print ' play #%d (%s): host count=%d' % (playnum, label, len(hosts))
for host in hosts:
print ' %s' % host
if options.listtasks:
+ if options.subset and not hosts:
+ continue
matched_tags, unmatched_tags = play.compare_tags(pb.only_tags)
unmatched_tags.discard('all')
unknown_tags = set(pb.only_tags) - (matched_tags | unmatched_tags)