diff --git a/lib/ansible/plugins/inventory/foreman.py b/lib/ansible/plugins/inventory/foreman.py index 874187186ec..996f7d88359 100644 --- a/lib/ansible/plugins/inventory/foreman.py +++ b/lib/ansible/plugins/inventory/foreman.py @@ -175,7 +175,7 @@ class InventoryModule(BaseInventoryPlugin, Cacheable): url = "%s/api/v2/hosts/%s" % (self.foreman_url, hid) ret = self._get_json(url, [404]) if not ret or not isinstance(ret, MutableMapping) or not ret.get('all_parameters', False): - ret = [] + return {} return ret.get('all_parameters') def _get_facts_by_id(self, hid):