From e564de3983939a2f8fa8378dc3cbd51a084024c1 Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Sat, 9 Feb 2013 11:28:59 -0500 Subject: [PATCH] Some formatting preferences for --list-hosts and --list-tasks --- bin/ansible-playbook | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/ansible-playbook b/bin/ansible-playbook index 3727ebcf60..c476470127 100755 --- a/bin/ansible-playbook +++ b/bin/ansible-playbook @@ -136,7 +136,9 @@ def main(args): ) if options.listhosts or options.listtasks: + print '' print 'playbook: %s' % playbook + print '' playnum = 0 for (play_ds, play_basedir) in zip(pb.playbook, pb.play_basedirs): playnum += 1 @@ -144,7 +146,7 @@ def main(args): label = play.name if options.listhosts: hosts = pb.inventory.list_hosts(play.hosts) - print ' hosts in play %s (%s): #%d' % (playnum, label, len(hosts)) + print ' play #%d (%s): host count=%d' % (playnum, label, len(hosts)) for host in hosts: print ' %s' % host if options.listtasks: @@ -156,10 +158,11 @@ def main(args): unknown = ','.join(sorted(unknown_tags)) unmatched = ','.join(sorted(unmatched_tags)) raise errors.AnsibleError(msg % (unknown, unmatched)) - print ' tasks in play %s (%s): #%d' % (playnum, label, len(play.tasks())) + print ' play #%d (%s): task count=%d' % (playnum, label, len(play.tasks())) for task in play.tasks(): if set(task.tags).intersection(pb.only_tags): print ' %s' % task.name + print '' continue if options.syntax: