Software Development Kit (SDK) and API Discussions

Ansible ONTAP LIF delete not working

marks
2,109 Views

Hi guys,

I have a playbook where I'm using the na_ontap_interface module in a lab. I can create a broadcast-domain-wide or local-only LIF in the default (cluster) SVM. I can also set the LIF state up or down, but I've not been able to get the playbook to delete the LIF. Any ideas what the issue might be?


Here's the environment:

ansible [core 2.13.1]

netapp-lib 2021.6.25

python version = 3.9.13

ONTAP 9.10.1 sim


The section of the runbook that doesn't work is as follows. No error is given, it just silently fails - as far as I can tell, even with -vvv output.

- name: Delete LIF
na_ontap_interface:
state: absent
interface_name: "{{ cluster }}-01_mgmt_auto"
vserver: "{{ cluster }}"
hostname: "{{ cluster_mgmt }}"
<<: *login

Runbook and input yaml files attached.

1 ACCEPTED SOLUTION

LaurentN
2,055 Views

It would help to see the output from ansible-playbook, the more with -vvv to examine the input parameters.
I assume it just says "changed": false. 
It would mean the interface is not found, so it's not deleted.   Most likely the module is using REST (this is controlled by use_rest, and defaults to auto).  REST only recognizes data vservers, so the trick for cluster scoped interfaces is to omit the vserver options, or to set it to NULL.  
This is something we changed recently, so knowing the version of the ONTAP Ansible collection would help.

View solution in original post

2 REPLIES 2

LaurentN
2,056 Views

It would help to see the output from ansible-playbook, the more with -vvv to examine the input parameters.
I assume it just says "changed": false. 
It would mean the interface is not found, so it's not deleted.   Most likely the module is using REST (this is controlled by use_rest, and defaults to auto).  REST only recognizes data vservers, so the trick for cluster scoped interfaces is to omit the vserver options, or to set it to NULL.  
This is something we changed recently, so knowing the version of the ONTAP Ansible collection would help.

marks
1,975 Views

Thanks @LaurentN 👍

These two options did the trick:

  • omitting vserver:
  • leaving vserver: and adding use_rest: never

'ansible-galaxy collection list' shows that the netapp.ontap version is 21.19.1

Public