You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Upon further investigation, it appears that the compose variable is incorrectly defined in the DOCUMENTATION block in the netbird.py inventory file. This is causing errors when people are passing in ansible mapping types.
Originally posted by ipsecguy April 3, 2024
Hi, I am using ansible core 2.16.5 on debian 12 and pulled this netbird plugin via ansible-galaxy collection install dominion_solutions.netbird
After some trouble getting it running (mostly due to me getting started with dynamic inventories) I am now getting a proper list of netbird devices out of the inventory.
Additionally, the error message about invalid characters does not seem correct, there are no curly braces in.
ansible-inventory [core 2.16.5]
config file = /etc/ansible/ansible.cfg
configured module search path = ['/home/ansible/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3/dist-packages/ansible
ansible collection location = /home/ansible/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/bin/ansible-inventory
python version = 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0] (/usr/bin/python3)
jinja version = 3.1.2
libyaml = True
Using /etc/ansible/ansible.cfg as config file
setting up inventory plugins
Loading collection ansible.builtin from
host_list declined parsing /home/ansible/ansible/inventory.netbird.yml as it did not pass its verify_file() method
script declined parsing /home/ansible/ansible/inventory.netbird.yml as it did not pass its verify_file() method
Loading collection dominion_solutions.netbird from /home/ansible/.ansible/collections/ansible_collections/dominion_solutions/netbird
Using inventory plugin 'ansible_collections.dominion_solutions.netbird.plugins.inventory.netbird' to process inventory source '/home/ansible/ansible/inventory.netbird.yml'
toml declined parsing /home/ansible/ansible/inventory.netbird.yml as it did not pass its verify_file() method
[WARNING]: * Failed to parse /home/ansible/ansible/inventory.netbird.yml with auto plugin: Unhandled exception when retrieving compose: unhashable type: 'AnsibleMapping'. unhashable type: 'AnsibleMapping'
File "/usr/lib/python3/dist-packages/ansible/inventory/manager.py", line 293, in parse_source
plugin.parse(self._inventory, self._loader, source, cache=cache)
File "/usr/lib/python3/dist-packages/ansible/plugins/inventory/auto.py", line 59, in parse
plugin.parse(inventory, loader, path, cache=cache)
File "/home/ansible/.ansible/collections/ansible_collections/dominion_solutions/netbird/plugins/inventory/netbird.py", line 217, in parse
self._options = self._read_config_data(path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/ansible/plugins/inventory/__init__.py", line 240, in _read_config_data
self.set_options(direct=config, var_options=self._vars)
File "/usr/lib/python3/dist-packages/ansible/plugins/__init__.py", line 106, in set_options
self._options = C.config.get_plugin_options(self.plugin_type, self._load_name, keys=task_keys, variables=var_options, direct=direct)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/ansible/config/manager.py", line 354, in get_plugin_options
options[option] = self.get_config_value(option, plugin_type=plugin_type, plugin_name=name, keys=keys, variables=variables, direct=direct)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/ansible/config/manager.py", line 450, in get_config_value
raise AnsibleError("Unhandled exception when retrieving %s:\n%s" % (config, to_native(e)), orig_exc=e)
[WARNING]: * Failed to parse /home/ansible/ansible/inventory.netbird.yml with yaml plugin: Plugin configuration YAML file, not YAML inventory
File "/usr/lib/python3/dist-packages/ansible/inventory/manager.py", line 293, in parse_source
plugin.parse(self._inventory, self._loader, source, cache=cache)
File "/usr/lib/python3/dist-packages/ansible/plugins/inventory/yaml.py", line 114, in parse
raise AnsibleParserError('Plugin configuration YAML file, not YAML inventory')
[WARNING]: * Failed to parse /home/ansible/ansible/inventory.netbird.yml with ini plugin: Invalid host pattern '---' supplied, '---' is normally a sign this is a YAML file.
File "/usr/lib/python3/dist-packages/ansible/inventory/manager.py", line 293, in parse_source
plugin.parse(self._inventory, self._loader, source, cache=cache)
File "/usr/lib/python3/dist-packages/ansible/plugins/inventory/ini.py", line 138, in parse
raise AnsibleParserError(e)
[WARNING]: Unable to parse /home/ansible/ansible/inventory.netbird.yml as an inventory source
[WARNING]: No inventory was parsed, only implicit localhost is available
{
"_meta": {
"hostvars": {}
},
"all": {
"children": [
"ungrouped"
]
}
}
I am using the hosted test version of netbird, if that makes a difference.
The text was updated successfully, but these errors were encountered:
Upon further investigation, it appears that the compose variable is incorrectly defined in the
DOCUMENTATION
block in the netbird.py inventory file. This is causing errors when people are passing in ansible mapping types.Discussed in #27
Originally posted by ipsecguy April 3, 2024
Hi, I am using ansible core 2.16.5 on debian 12 and pulled this netbird plugin via ansible-galaxy collection install dominion_solutions.netbird
After some trouble getting it running (mostly due to me getting started with dynamic inventories) I am now getting a proper list of netbird devices out of the inventory.
Additionally, the error message about invalid characters does not seem correct, there are no curly braces in.
inventory.netbird.yml
ansible-inventory --list -i inventory.netbird.yml -vvvv
However, when I add any compose: to add variables (I started with adding a static value)
However, when I add this and run
ansible-inventory --list -i inventory.netbird.yml -vvvv
I am using the hosted test version of netbird, if that makes a difference.
The text was updated successfully, but these errors were encountered: