�
�Udac @` s� d d l m Z m Z m Z e Z i d d 6d g d 6d d 6Z d Z d Z d
Z d d l
Z
d d l m Z d d
l
m Z d d l j j Z d d l m Z e j � Z d e f d � � YZ d � Z e d k r� e � n d S( i ( t absolute_importt divisiont print_functions 1.1t metadata_versiont previewt statust certifiedt supported_bys�
module: na_ontap_quotas
short_description: NetApp ONTAP Quotas
extends_documentation_fragment:
- netapp.na_ontap
version_added: '2.8'
author: NetApp Ansible Team (@carchi8py) <[email protected]>
description:
- Set/Modify/Delete quota on ONTAP
options:
state:
description:
- Whether the specified quota should exist or not.
choices: ['present', 'absent']
default: present
type: str
vserver:
required: true
description:
- Name of the vserver to use.
type: str
volume:
description:
- The name of the volume that the quota resides on.
required: true
type: str
quota_target:
description:
- The quota target of the type specified.
required: true
type: str
qtree:
description:
- Name of the qtree for the quota.
- For user or group rules, it can be the qtree name or "" if no qtree.
- For tree type rules, this field must be "".
default: ""
type: str
type:
description:
- The type of quota rule
choices: ['user', 'group', 'tree']
required: true
type: str
policy:
description:
- Name of the quota policy from which the quota rule should be obtained.
type: str
set_quota_status:
description:
- Whether the specified volume should have quota status on or off.
type: bool
file_limit:
description:
- The number of files that the target can have.
default: '-'
type: str
disk_limit:
description:
- The amount of disk space that is reserved for the target.
default: '-'
type: str
threshold:
description:
- The amount of disk space the target would have to exceed before a message is logged.
default: '-'
type: str
sy
- name: Add/Set quota
na_ontap_quotas:
state: present
vserver: ansible
volume: ansible
quota_target: /vol/ansible
type: user
policy: ansible
file_limit: 2
disk_limit: 3
set_quota_status: True
hostname: "{{ netapp_hostname }}"
username: "{{ netapp_username }}"
password: "{{ netapp_password }}"
- name: modify quota
na_ontap_quotas:
state: present
vserver: ansible
volume: ansible
quota_target: /vol/ansible
type: user
policy: ansible
file_limit: 2
disk_limit: 3
threshold: 3
set_quota_status: False
hostname: "{{ netapp_hostname }}"
username: "{{ netapp_username }}"
password: "{{ netapp_password }}"
- name: Delete quota
na_ontap_quotas:
state: absent
vserver: ansible
volume: ansible
quota_target: /vol/ansible
type: user
policy: ansible
hostname: "{{ netapp_hostname }}"
username: "{{ netapp_username }}"
password: "{{ netapp_password }}"
s
N( t
AnsibleModule( t to_native( t NetAppModulet NetAppONTAPQuotasc B` sV e Z d Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z d � Z
RS( s Class with quotas methodsc C` s� t j � | _ | j j t d t d t d d d g d d � d t d t d d � d
t d t d d � d t d t d d � d t d t d d d d
� d t d t d d d d d d g � d t d t d d � d t d t d d � d t d t d d d d � d t d t d d d d � d t d t d d d d � � � t d | j d t � | _ t � | _
| j
j | j j � | _
t t k r�| j j d d � n% t j d | j d | j
d � | _ d S( Nt statet requiredt choicest presentt absentt defaultt vservert typet strt volumet quota_targett qtreet t usert groupt treet policyt set_quota_statust boolt
file_limitt -t
disk_limitt thresholdt
argument_spect supports_check_modet msgs( the python NetApp-Lib module is requiredt module( t netapp_utilst na_ontap_host_argument_specR# t updatet dictt Falset TrueR R&