Skip to content

[Bug]: version check error? #1329

Open
Open
@lTomBackl

Description

@lTomBackl

Ansible NetBox Collection version

v3.20.0

Ansible version

ansible [core 2.16.11]
config file = /work/ansible.cfg
configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python3.12/site-packages/ansible
ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/bin/ansible
python version = 3.12.6 (main, Sep 11 2024, 08:48:26) [GCC 13.2.1 20240309] (/usr/bin/python3)
jinja version = 3.1.4
libyaml = True

NetBox version

v4.1.1

Python version

3.11

Steps to Reproduce

Exception when running the following playbook to create a VM:

---
- name: Create VM
  hosts: localhost
  gather_facts: false

  vars_files:
    - /work/secrets/netbox.yml

  tasks:

    - name: Create virtual machine
      netbox.netbox.netbox_virtual_machine:
        netbox_url: "{{ netbox_url }}"
        netbox_token: "{{ netbox_token }}"
        data:
          name: Test VM
          cluster: mycluster
        state: present

I do also use nb_inventory without any issues.

Could it be, that there is a version check issue -> observed error:

... netbox_utils.py", line 782, in _version_check_greater
ValueError: not enough values to unpack (expected 2, got 1)

Thank you

Expected Behavior

create a vm object in netbox

Observed Behavior

PLAY [Create VM] ******************************************************************************************************************************************************************

TASK [Create virtual machine within NetBox] ***************************************************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ValueError: not enough values to unpack (expected 2, got 1)
fatal: [localhost]: FAILED! => changed=false
  module_stderr: |-
    Traceback (most recent call last):
      File "/root/.ansible/tmp/ansible-tmp-1727427640.0271611-503-166887187380580/AnsiballZ_netbox_virtual_machine.py", line 107, in <module>
        _ansiballz_main()
      File "/root/.ansible/tmp/ansible-tmp-1727427640.0271611-503-166887187380580/AnsiballZ_netbox_virtual_machine.py", line 99, in _ansiballz_main
        invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
      File "/root/.ansible/tmp/ansible-tmp-1727427640.0271611-503-166887187380580/AnsiballZ_netbox_virtual_machine.py", line 47, in invoke_module
        runpy.run_module(mod_name='ansible_collections.netbox.netbox.plugins.modules.netbox_virtual_machine', init_globals=dict(_module_fqn='ansible_collections.netbox.netbox.plugins.modules.netbox_virtual_machine', _modlib_path=modlib_path),
      File "<frozen runpy>", line 226, in run_module
      File "<frozen runpy>", line 98, in _run_module_code
      File "<frozen runpy>", line 88, in _run_code
      File "/tmp/ansible_netbox.netbox.netbox_virtual_machine_payload_aohgjsha/ansible_netbox.netbox.netbox_virtual_machine_payload.zip/ansible_collections/netbox/netbox/plugins/modules/netbox_virtual_machine.py", line 267, in <module>
      File "/tmp/ansible_netbox.netbox.netbox_virtual_machine_payload_aohgjsha/ansible_netbox.netbox.netbox_virtual_machine_payload.zip/ansible_collections/netbox/netbox/plugins/modules/netbox_virtual_machine.py", line 262, in main
      File "/tmp/ansible_netbox.netbox.netbox_virtual_machine_payload_aohgjsha/ansible_netbox.netbox.netbox_virtual_machine_payload.zip/ansible_collections/netbox/netbox/plugins/module_utils/netbox_virtualization.py", line 25, in __init__
      File "/tmp/ansible_netbox.netbox.netbox_virtual_machine_payload_aohgjsha/ansible_netbox.netbox.netbox_virtual_machine_payload.zip/ansible_collections/netbox/netbox/plugins/module_utils/netbox_utils.py", line 772, in __init__
      File "/tmp/ansible_netbox.netbox.netbox_virtual_machine_payload_aohgjsha/ansible_netbox.netbox.netbox_virtual_machine_payload.zip/ansible_collections/netbox/netbox/plugins/module_utils/netbox_utils.py", line 1252, in _find_ids
      File "/tmp/ansible_netbox.netbox.netbox_virtual_machine_payload_aohgjsha/ansible_netbox.netbox.netbox_virtual_machine_payload.zip/ansible_collections/netbox/netbox/plugins/module_utils/netbox_utils.py", line 782, in _version_check_greater
    ValueError: not enough values to unpack (expected 2, got 1)
  module_stdout: ''
  msg: |-
    MODULE FAILURE
    See stdout/stderr for the exact error
  rc: 1

PLAY RECAP ************************************************************************************************************************************************************************localhost                  : ok=0    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions