General Discussion

Help with Ansible with YAML setting the quota_target with type tree

SCL
1,022 Views

Hi,

 

I am trying to use Ansible with Yaml to set quota rules with type 'tree'. But, I seem unable to set the default quota_target value to "". Any help on how to get this done would be appreciated.

 

Here is my Ansible code snippet:

- name: run ontap na_ontap_quotas
  netapp.ontap.na_ontap_quotas:
    state: "{{ item.state | default('present') }}"
    vserver: "{{ item.vserver }}"
    volume: "{{ item.volume }}"
    quota_target: "{{ item.quota_target | default('""') }}"
    type: "{{ item.type | default('tree') }}"
    disk_limit: "{{ item.disk_limit | default('200GB') }}"
    threshold: "{{ item.threshold | default('180GB') }}"
    soft_file_limit: "{{ item.soft_file_limit | default('160GB') }}"
    policy: "{{ item.policy | default(omit) }}"
    set_quota_status: "{{ item.set_quota_status | default('on') }}"
    <<: *login
  with_items: "{{ qtrees }}"

 

I tried several combinations of double quotes and single quotes and escaping them and each time getting either a linter error or a syntax error (because I seem unable to pass in "" as a literal value for the target).

 

Thanks!

1 ACCEPTED SOLUTION

SCL
990 Views

Please ignore this. I found my mistake. I forgot to update the 'with_items' line appropriately. How to delete this thread?

View solution in original post

1 REPLY 1

SCL
991 Views

Please ignore this. I found my mistake. I forgot to update the 'with_items' line appropriately. How to delete this thread?

Public