mirror of
https://github.com/ansible/awx.git
synced 2026-05-13 04:17:36 -02:30
add back in support of towervars lost in merge
This commit is contained in:
@@ -209,7 +209,7 @@ class Inventory(CommonModelNameNotUnique, ResourceMixin):
|
||||
group_children.add(from_group_id)
|
||||
return group_children_map
|
||||
|
||||
def get_script_data(self, hostvars=False, show_all=False):
|
||||
def get_script_data(self, hostvars=False, towervars=False, show_all=False):
|
||||
if show_all:
|
||||
hosts_q = dict()
|
||||
else:
|
||||
@@ -271,6 +271,10 @@ class Inventory(CommonModelNameNotUnique, ResourceMixin):
|
||||
data['_meta'].setdefault('hostvars', dict())
|
||||
for host in self.hosts.filter(**hosts_q):
|
||||
data['_meta']['hostvars'][host.name] = host.variables_dict
|
||||
if towervars:
|
||||
tower_dict = dict(remote_tower_enabled=str(host.enabled).lower(),
|
||||
remote_tower_id=host.id)
|
||||
data['_meta']['hostvars'][host.name].update(tower_dict)
|
||||
|
||||
return data
|
||||
|
||||
|
||||
Reference in New Issue
Block a user