Open ashtarcommunications opened 4 months ago
Files identified in the description:
If these files are incorrect, please update the component name
section of the description or use the !component
bot command.
cc @Charliekenney23 @InTheCloudDan @LBGarber @decentral1se @displague @rmcintosh click here for bot help
It looks like pools
was renamed to ranges
in https://github.com/linode/linode_api4-python/commit/dc592c706518abc1c6d4b4c88b074970e5375d5f. This was introduced in version 5.4.1: https://github.com/linode/linode_api4-python/releases/tag/v5.4.1
(I really wonder what kind of versioning scheme they use? Breaking changes in a patch version doesn't sound like a good idea to me... Also the PR doesn't mention any kind of motivation for the rename, which doesn't make it any better...)
I created a PR to fix this, could you please test it? https://github.com/ansible-collections/community.general/pull/8248
(I have no way to test this.)
I get: 'IPv6Range' object has no attribute 'type' and the inventory fails to parse
Can you paste the full stack trace? Thanks.
Failed to parse linode.yml with ansible_collections.community.general.plugins.inventory.linode plugin:
'IPv6Range' object has no attribute 'type'
File "/home/<user>/.local/lib/python3.11/site-packages/ansible/inventory/manager.py", line 293, in parse_source
plugin.parse(self._inventory, self._loader, source, cache=cache)
File "/home/<user>/.ansible/collections/ansible_collections/community/general/plugins/inventory/linode.py", line 334, in parse
self.populate()
File "/home/<user>/.ansible/collections/ansible_collections/community/general/plugins/inventory/linode.py", line 262, in populate
self._add_hostvars_for_instances()
File "/home/<user>/.ansible/collections/ansible_collections/community/general/plugins/inventory/linode.py", line 229, in _add_hostvars_for_instances
for ip_type in set(ip.type for ip in ips):
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/<user>/.ansible/collections/ansible_collections/community/general/plugins/inventory/linode.py", line 229, in <genexpr>
for ip_type in set(ip.type for ip in ips):
^^^^^^^
File "/home/<user>/.local/lib/python3.11/site-packages/linode_api4/objects/base.py", line 227, in __getattribute__
return object.__getattribute__(self, name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
I guess in that case further things have changed in a backwards incompatible way. It's probably best if someone who can actually run the plugin against the real service continues debugging and fixing this.
Summary
The linode dynamic inventory plugin fails to parse the inventory when ip_style is set to "api", with an error about a missing attribute
instance.ips.ipv6.pools
This appears to be due to line 221:
I don't see
Issue Type
Bug Report
Component Name
linode
Ansible Version
Community.general Version
Configuration
OS / Environment
Ubuntu 23.04
Steps to Reproduce
Expected Results
Would expect the inventory plugin to correctly parse the response from the linode API
Actual Results
Code of Conduct