#Snapshot Policy creation not idempotent?

1 messages · Page 1 of 1 (latest)

pure quest
#

I created a playbook to setup Snapshot policies on our OnTap clusters. It works fine to create them initially, but when I run it after the initial setup, I get the errors below that the policies already exist. Shouldn't this be idempotent? If I run the play with a --check it completes ok, but shows that each policy is "changed". But they all fail when I do the actual run. Playbook is attached.

failed: [cluster01] (item={'policy': 'snapshot_1day_0hrly', 'schedule': 'snapsched_daily_0010', 'count': '1', 'label': 'daily'}) => {"ansible_loop_var": "item", "changed": false, "item": {"count": "1", "label": "daily", "policy": "snapshot_1day_0hrly", "schedule": "snapsched_daily_0010"}, "msg": "Error on creating snapshot policy: calling: storage/snapshot-policies: got {'message': 'Policy name \"snapshot_1day_0hrly\" already exists. ', 'code': '1638527'}."}```
cyan junco
#

do not set vserver for creating cluster scoped policy in REST.