diff --git a/lib/ansible/cli/adhoc.py b/lib/ansible/cli/adhoc.py index 9d1ab681da..71c76374c3 100644 --- a/lib/ansible/cli/adhoc.py +++ b/lib/ansible/cli/adhoc.py @@ -111,6 +111,7 @@ class AdHocCLI(CLI): self.display.warning("provided hosts list is empty, only localhost is available") if self.options.listhosts: + self.display.display(' hosts (%d):' % len(hosts)) for host in hosts: self.display.display(' %s' % host) return 0 diff --git a/lib/ansible/cli/playbook.py b/lib/ansible/cli/playbook.py index 44cc251502..9a2a9a0ad7 100644 --- a/lib/ansible/cli/playbook.py +++ b/lib/ansible/cli/playbook.py @@ -166,7 +166,7 @@ class PlaybookCLI(CLI): if self.options.listhosts: playhosts = set(inventory.get_hosts(play.hosts)) - msg += "\n pattern: %s\n total hosts: %d\n hosts:" % (play.hosts, len(playhosts)) + msg += "\n pattern: %s\n hosts (%d):" % (play.hosts, len(playhosts)) for host in playhosts: msg += "\n %s" % host