Get (potentially) new composite host vars from inventory (#32606)

* Get new composite host vars from inventory

* Remove spaces from blank line
This commit is contained in:
Denver Janke 2017-11-08 14:10:00 +10:00 committed by ansibot
parent 1fd454e5b5
commit 57106662db

View file

@ -116,6 +116,11 @@ class InventoryModule(BaseInventoryPlugin):
# create composite vars
self._set_composite_vars(data.get('compose'), hostvars, host, strict=strict)
# refetch host vars in case new ones have been created above
hostvars = inventory.hosts[host].get_vars()
if host in self._cache: # adds facts if cache is active
hostvars = combine_vars(hostvars, self._cache[host])
# constructed groups based on conditionals
self._add_host_to_composed_groups(data.get('groups'), hostvars, host, strict=strict)