-
Notifications
You must be signed in to change notification settings - Fork 253
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Ansible NetBox Collection version
v3.21.0
Ansible version
ansible [core 2.15.13]When using netbox.netbox.netbox_permission to update given permissions, the field object_types always gets return as changed, cause the list is compared as list, not set. The order of the object_types it applies to are not important.
This is similar to tags
I would propose to
a) bring this in line with the pynetbox response (which defines fields are sets)
b) define the field object_types as set as well (pynetbox as well)
NetBox version
v4.4.6
Python version
3.9
Steps to Reproduce
- name: update permissions
netbox.netbox.netbox_permission:
netbox_url: ENDPOINT_URL
netbox_token: API_TOKEN
data:
name: example-permission
enabled: true
actions: ['view', 'add', 'change', 'delete']
object_types:
- dcim.interface
- dcim.module
- dcim.device
constraints: {}
Depending on the response and your given order, ansible always detects a change.
Expected Behavior
When the list of object_types the permissions applies to doesn't change, ansible should not report that something has changed.
Observed Behavior
[...]
changed: [netbox-vm] => (item=ipam-perms)
ok: [netbox-vm] => (item=ipam-perms)
--- before
+++ after
@@ -1,8 +1,8 @@
object_types:
+ - ipam.ipaddress
+ - ipam.prefix
- ipam.vrf
- - ipam.prefix
- - ipam.iprange
- - ipam.ipaddress
- ipam.vlangroup
- ipam.vlan
+ - ipam.iprange
[...]
As you see, the order ist always random (iprange > vrf ....)
peteeckel
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working