1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

make --list-hosts expand out extra vars in the hosts: field

This commit is contained in:
Seth Vidal 2012-12-11 14:12:10 -05:00
parent 959a461080
commit 0f6669fafe

View file

@ -131,7 +131,8 @@ def main(args):
label = 'unnamed' label = 'unnamed'
if 'name' in play: if 'name' in play:
label = play['name'] label = play['name']
hosts = pb.inventory.list_hosts(play['hosts']) tmp_hosts = utils.template(pb.basedir, play['hosts'], extra_vars)
hosts = pb.inventory.list_hosts(tmp_hosts)
print ' hosts in play %s (%s): #%d' % (playnum, label, len(hosts)) print ' hosts in play %s (%s): #%d' % (playnum, label, len(hosts))
for host in hosts: for host in hosts:
print ' %s' % host print ' %s' % host