diff --git a/changelogs/fragments/openstack_inventory_fix.yml b/changelogs/fragments/openstack_inventory_fix.yml new file mode 100644 index 00000000000..890e6277d2b --- /dev/null +++ b/changelogs/fragments/openstack_inventory_fix.yml @@ -0,0 +1,2 @@ +bugfixes: + - allow using openstack inventory plugin w/o a cache diff --git a/lib/ansible/plugins/inventory/openstack.py b/lib/ansible/plugins/inventory/openstack.py index dc720f4694b..f857a27cda6 100644 --- a/lib/ansible/plugins/inventory/openstack.py +++ b/lib/ansible/plugins/inventory/openstack.py @@ -196,7 +196,8 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable): source_data = cloud_inventory.list_hosts( expand=expand_hostvars, fail_on_cloud_config=fail_on_errors) - self.cache.set(cache_key, source_data) + if self.cache is not None: + self.cache.set(cache_key, source_data) self._populate_from_source(source_data)