#na_ontap_export_policy_rule - Error multiple records exist

1 messages · Page 1 of 1 (latest)

thorny falcon
#

Hello,

I have a playbook that is using the na_ontap_export_policy_rule module and it is failing with the following message:

"Error multiple records exist for query: {'fields': 'anonymous_user,clients,index,protocols,ro_rule,rw_rule,superuser,ntfs_unix_security,allow_suid,chown_mode,allow_device_creation', 'protocols': 'nfs3', 'superuser': 'none', 'clients.match': 'client_match', 'ro_rule': 'sys', 'rw_rule': 'never'}

Below are the details of the module in my playbook.

  • name: "Create export rule"
    na_ontap_export_policy_rule:
    state: present
    name: "default"
    vserver: "{{ vserver_name }}"
    client_match: "{{ client_match }}"
    ro_rule: 'sys'
    rw_rule: 'never'
    protocol: 'nfs3'
    super_user_security: 'none'
    force_delete_on_first_match: true
    <<: *login
    when: backups_required and logs_required

According to the na_ontap_export_policy_rule documentation, the comments for the parameter "force_delete_on_first_match" state:

when rule_index is not set, the default is to report an error on multiple matches.

when this option is set, one of the rules with an exact match is deleted when state is absent.

ignored when state is present.

Wouldn't my code be ignored in the case where a rule with an exact match is found since I have the state set to present?

The netapp.ontap collection that I am using is 22.7.0.

steady hemlock
#

@thorny falcon hi, a bug fix for idempotency was released in 22.12.0 collection version
na_ontap_export_policy_rule - fix issue with idempotency in REST.
could you try switching to newer collection release and let us know if the error still persists?