Make safe variable duplications for rename (#5093)

* Make safe variable duplications to controller

* Back out some changes to be smarter

* Update test to new vars
This commit is contained in:
Alan Rominger
2021-06-18 14:14:07 -04:00
committed by Shane McDonald
parent 95e796a88a
commit a8083296e6
3 changed files with 9 additions and 1 deletions

View File

@@ -306,7 +306,12 @@ class Inventory(CommonModelNameNotUnique, ResourceMixin, RelatedJobsMixin):
for host in hosts:
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)
tower_dict = dict(
remote_tower_enabled=str(host.enabled).lower(),
remote_tower_id=host.id,
remote_host_enabled=str(host.enabled).lower(),
remote_host_id=host.id,
)
data['_meta']['hostvars'][host.name].update(tower_dict)
return data