I am having some issues creating Snapmirror policies on a 9.8 cluster. When I initially run the playbook, it creates the policy without any issue, but on subsequent runs it errors out because the rule I am trying to create already exists. I have to use ZAPI because the "copy_all_source_snapshots" is not supported until OnTap 9.10.1, so it was erroring out when I tried to use REST.
Is there a way around this? Or, do I have to query the policies to see if the rules exist and then skip that step if they are already there? I would rather not go through that though if this can be idempotent.
This is the error message I'm getting. The policy I'm trying to get and the playbook are attached:
TASK [Create Snapmirror policy] ********************************************************************************************************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: netapp_lib.api.zapi.zapi.NaApiError: NetApp API failed. Reason - 13001:Rule for "-snapmirror-label all_source_snapshots" already exists in policy "custom_snapmirror".
[WARNING]: With version 22.0.0 ONTAPI (ZAPI) has been deprecated. The final ONTAP version to support ZAPI is ONTAP 9.12.1. ZAPI calls in these modules will continue to work for ONTAP versions that supports ZAPI. You
can update your playbook to use REST by adding use_rest: always to your playbook. More information can be found at: https://github.com/ansible-collections/netapp.ontap
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Error modifying snapmirror policy rule custom_snapmirror: NetApp API failed. Reason - 13001:Rule for "-snapmirror-label all_source_snapshots" already exists in policy "custom_snapmirror"."}