Skip to content

tasks with lists of data are not idempotent #526

@cardoe

Description

@cardoe
ISSUE TYPE

Bug Report

SOFTWARE VERSIONS
pynautobot

2.6.1

Ansible:

ansible-core==2.18.4

Nautobot:

2.4.5

Collection:

Collection Version


community.general 10.4.0
networktocode.nautobot 5.9.0

SUMMARY

So main example I see this with is content_type. For example if I create a location_type and supply it a list of content_type. If my list isn't ordered the same way that the API returns it back then the ansible module will report that a change was made every single time.

STEPS TO REPRODUCE
- name: Test
  networktocode.nautobot.location_type:
    name: "test"
    description: "test"
    content_types:
      - "dcim.device"
      - "dcim.rack"
      - "dcim.rackgroup"
      - "ipam.namespace"
      - "ipam.prefix"
      - "ipam.vlangroup"
      - "ipam.vlan"
    nestable: "false"
    state: present
EXPECTED RESULTS

This task should run each time and not show any changes.

ACTUAL RESULTS

The content_types show a change every time.

Metadata

Metadata

Assignees

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