From 40fb0f0c75909fa8a9f9f77d6b41a3fda9612b9d Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Wed, 18 Jun 2025 21:38:59 +0200 Subject: [PATCH] Inventory plugins: remove deprecated disable_lookups parameter (which was set to its default anyway) (#10271) * Remove default value for keyword argument that is deprecated since ansible-core 2.19. * Add changelog fragment. --- changelogs/fragments/10271--disable_lookups.yml | 3 +++ plugins/inventory/icinga2.py | 6 +++--- plugins/inventory/linode.py | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 changelogs/fragments/10271--disable_lookups.yml diff --git a/changelogs/fragments/10271--disable_lookups.yml b/changelogs/fragments/10271--disable_lookups.yml new file mode 100644 index 0000000000..d28e2ac833 --- /dev/null +++ b/changelogs/fragments/10271--disable_lookups.yml @@ -0,0 +1,3 @@ +bugfixes: + - "icinga2 inventory plugin - avoid using deprecated option when templating options (https://github.com/ansible-collections/community.general/pull/10271)." + - "linode inventory plugin - avoid using deprecated option when templating options (https://github.com/ansible-collections/community.general/pull/10271)." diff --git a/plugins/inventory/icinga2.py b/plugins/inventory/icinga2.py index feb2d10d8a..5b549d8e9c 100644 --- a/plugins/inventory/icinga2.py +++ b/plugins/inventory/icinga2.py @@ -291,11 +291,11 @@ class InventoryModule(BaseInventoryPlugin, Constructable): self.group_by_hostgroups = self.get_option('group_by_hostgroups') if self.templar.is_template(self.icinga2_url): - self.icinga2_url = self.templar.template(variable=self.icinga2_url, disable_lookups=False) + self.icinga2_url = self.templar.template(variable=self.icinga2_url) if self.templar.is_template(self.icinga2_user): - self.icinga2_user = self.templar.template(variable=self.icinga2_user, disable_lookups=False) + self.icinga2_user = self.templar.template(variable=self.icinga2_user) if self.templar.is_template(self.icinga2_password): - self.icinga2_password = self.templar.template(variable=self.icinga2_password, disable_lookups=False) + self.icinga2_password = self.templar.template(variable=self.icinga2_password) self.icinga2_url = f"{self.icinga2_url.rstrip('/')}/v1" diff --git a/plugins/inventory/linode.py b/plugins/inventory/linode.py index 3e7ddc5a82..53d86f21d3 100644 --- a/plugins/inventory/linode.py +++ b/plugins/inventory/linode.py @@ -150,7 +150,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable): access_token = self.get_option('access_token') if self.templar.is_template(access_token): - access_token = self.templar.template(variable=access_token, disable_lookups=False) + access_token = self.templar.template(variable=access_token) if access_token is None: raise AnsibleError((