Skip to content

netbox_ip_address cannot be used with VMs #156

Closed
@bluikko

Description

@bluikko
ISSUE TYPE
  • Bug Report
SOFTWARE VERSIONS
Ansible:

2.9.6

Netbox:

2.6.1

Collection:

0.1.10

SUMMARY

Trying to add an IP address to a VM with netbox_ip_address fails. This seems to be similar to the bug in the Ansible bundled Netbox module.

STEPS TO REPRODUCE
- name: Add IP address
  netbox.netbox.netbox_ip_address:
    netbox_url: "{{ netbox }}"
    netbox_token: "{{ token }}"
    data:
      family: 4
      address: "{{ ipv4 }}"
      interface:
        name: Eth0
        device: "{{ vmname }}"
      status: Active
      tenant: Test
    state: present
EXPECTED RESULTS

IP address should be assigned to the VM.

ACTUAL RESULTS

An error is displayed:

"msg": "{\"device_id\":[\"Enter a number.\"]}"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions