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

Fixes #731 by reinstating variables for inventory scripts

This commit is contained in:
Michael DeHaan 2012-07-30 19:26:46 -04:00
parent fe558f680a
commit da44fb1e43

View file

@ -163,6 +163,13 @@ class Inventory(object):
) )
(out, err) = cmd.communicate() (out, err) = cmd.communicate()
results = utils.parse_json(out) results = utils.parse_json(out)
# FIXME: this is a bit redundant with host.py and should share code
results['inventory_hostname'] = hostname
results['inventory_hostname_short'] = hostname.split('.')[0]
groups = [ g.name for g in host.get_groups() if g.name != 'all' ]
results['group_names'] = sorted(groups)
return results return results
host = self.get_host(hostname) host = self.get_host(hostname)