ansible_modules icon indicating copy to clipboard operation
ansible_modules copied to clipboard

[Bug]: Breaking changes in 3.6.0, choices -> choice_set

Open josh-d-smith opened this issue 2 years ago • 4 comments

NetBox 3.6.x Breaking Changes

v3.6 Breaking Changes

The choices array field has been removed from the CustomField model. Any defined choices are automatically migrated to CustomFieldChoiceSets, accessible via the new choice_set field on the CustomField model.

Ansible NetBox Collection version

v3.14.0

Ansible version

ansible [core 2.15.2]
  config file = None
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.10/dist-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0] (/usr/bin/python3)
  jinja version = 3.1.2
  libyaml = True

NetBox version

v3.6.1

Python version

3.10

Steps to Reproduce

Execute an ansible playbook that defines a custom field using the select type and pass in choices

- name: Create a custom field of type select
  netbox.netbox.netbox_custom_field:
  netbox_url: http://netbox.local
    netbox_token: thisIsMyToken
      data:
        name: A Custom Field
        type: select
        choices:
          - Pass
          - Fail
          - Win
          - Lose

Expected Behavior

  • The playbook should correctly create the custom field of the appropriate type.
  • Support the Custom Field Choice Sets as of NetBox v3.6.0
  • Have the ability to pass in a Custom Field Choice Set to the module netbox.netbox.netbox_custom_field

Observed Behavior

The playbook errors out as this call is not yet supported in this library for NetBox v3.6.0+.

josh-d-smith avatar Sep 13 '23 00:09 josh-d-smith

Any updates on this one, or possible workarounds?

MichaelSoegaard avatar Nov 20 '23 09:11 MichaelSoegaard

Any updates on this one, or possible workarounds?

I have the same question

jon-nfc avatar Apr 06 '24 08:04 jon-nfc

#1186 should resolve this? It is not part of a release yet, so please pull down the latest via Git and test

sc68cal avatar Apr 07 '24 17:04 sc68cal

That only solves the lookup @sc68cal , right? This doesnt help with creating selection custom fields or creating the choice sets themselves.

A new module is needed for the latter part, afaics?

I have this fixed locally, but I need to fix up the documentation still. (and look into what else is needed re tests etc)

p-rintz avatar Apr 07 '24 17:04 p-rintz