ONTAP Discussions

Unable to delete ntfs qtree with Ansible na_ontap_qtree module

DIS

Hello everyone,

We were able to automate the creation and removal processes of CIFS shares with Ansible, but we are facing some issue with the removal of the qtree.

Here are the steps we were able to do:

  • Delete quota with the "na_ontap_quotas" module

 

 

- name: Delete quota {{ share.name }}
  na_ontap_quotas:
    state: absent
    vserver: "{{ netapp_vserver }}"
    volume: "{{ share.volume }}"
    type: tree
    quota_target: "/vol/{{ share.volume }}/{{ share.name }}"
    hostname: "{{ netapp_hostname }}"
    username: "{{ netapp_username }}"
    password: "{{ netapp_password }}"

 

 

  • Delete share with the "na_ontap_cifs" module

 

 

- name: Delete Share {{ share.name }}
  na_ontap_cifs:
    state: absent
    share_name: '{{ share.name }}$'
    vserver: "{{ netapp_vserver }}"
    hostname: "{{ netapp_hostname }}"
    username: "{{ netapp_username }}"
    password: "{{ netapp_password }}"

 

 

  • And here is the step where we are facing the issue

 

 

- name: Delete Qtree {{ share.name }}
  na_ontap_qtree:
    state: absent
    name: "{{ share.name }}"
    flexvol_name: "{{ share.volume }}"
    security_style: ntfs
    vserver: "{{ netapp_vserver }}"
    hostname: "{{ netapp_hostname }}"
    username: "{{ netapp_username }}"
    password: "{{ netapp_password }}"

 

 

When we run the task to delete the qtree we get the following error

 

 

An exception occurred during task execution. To see the full traceback, use -vvv. The error was: KeyError: 'No element by given name mode.'

 

 

 

I've opened a ticket to netapp and they asked me this:

  • can you change the security style it and try to delete it again?
    • If I change it to unix on the web console, yes I'm able to delete the qtree with Ansible. I'm not able to change the security style with Ansible.
  • can you try to rename it and delete it afterwards ?
    • I get the same error, when I try to rename it with Ansible.

After that they asked me to open this discussion.

Has someone been able to delete ntfs qtrees with Ansible. Any idea on how to solve this issue.

 

Thanks in advance for your help!

Best regards,

David

1 REPLY 1

Re: Unable to delete ntfs qtree with Ansible na_ontap_qtree module

paul_stejskal

I found your case and went back and it looks like the ONTAPI response is successful. It may be helpful to run with the -vvv.

View solution in original post

Earn Rewards for Your Review!
GPI Review Banner
All Community Forums
Public