summaryrefslogtreecommitdiffstats
path: root/ansible_collections/dellemc/unity/playbooks/modules/tree_quota.yml
blob: 1665ea1185a1f8161216f4133c072b4cc9817528 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
---
- name: Tree Quota Operations
  hosts: localhost
  connection: local
  vars:
    unispherehost: '10.*.*.*'
    validate_certs: false
    username: 'user'
    password: '**'
    filesystem_name: "SP_Filesystem_test"
    filesystem_id: "fs_2279"
    nas_server_name: "lglad068"
    path: "/sample_quota"
    soft_limit: 2
    state_present: "present"
    state_absent: "absent"

  tasks:
    - name: Create quota tree of filesystem
      register: result
      dellemc.unity.tree_quota:
        unispherehost: "{{ unispherehost }}"
        username: "{{ username }}"
        password: "{{ password }}"
        validate_certs: "{{ validate_certs }}"
        filesystem_id: "{{ filesystem_id }}"
        path: "{{ path }}"
        hard_limit: 2
        cap_unit: "TB"
        description: "Sample quota tree"
        state: "{{ state_present }}"

    - name: Set tree_quota_id
      ansible.builtin.set_fact:
        tree_quota_id: "{{ result.get_tree_quota_details.id }}"

    - name: Create quota tree of filesystem -- Idempotency
      dellemc.unity.tree_quota:
        unispherehost: "{{ unispherehost }}"
        username: "{{ username }}"
        password: "{{ password }}"
        validate_certs: "{{ validate_certs }}"
        filesystem_id: "{{ filesystem_id }}"
        path: "{{ path }}"
        hard_limit: 2
        cap_unit: "TB"
        description: "Sample quota tree"
        state: "{{ state_present }}"

    - name: Get quota tree details by quota tree path
      dellemc.unity.tree_quota:
        unispherehost: "{{ unispherehost }}"
        username: "{{ username }}"
        password: "{{ password }}"
        validate_certs: "{{ validate_certs }}"
        filesystem_id: "{{ filesystem_id }}"
        path: "{{ path }}"
        state: "{{ state_present }}"

    - name: Get quota tree details by quota tree id
      dellemc.unity.tree_quota:
        unispherehost: "{{ unispherehost }}"
        username: "{{ username }}"
        password: "{{ password }}"
        validate_certs: "{{ validate_certs }}"
        filesystem_id: "{{ filesystem_id }}"
        tree_quota_id: "{{ tree_quota_id }}"
        state: "{{ state_present }}"

    - name: Modify quota tree of filesystem by quota tree path
      dellemc.unity.tree_quota:
        unispherehost: "{{ unispherehost }}"
        username: "{{ username }}"
        password: "{{ password }}"
        validate_certs: "{{ validate_certs }}"
        filesystem_id: "{{ filesystem_id }}"
        path: "{{ path }}"
        soft_limit: "{{ soft_limit }}"
        cap_unit: "TB"
        description: "Sample quota tree modified"
        state: "{{ state_present }}"

    - name: Modify quota tree of filesystem -- Idempotency
      dellemc.unity.tree_quota:
        unispherehost: "{{ unispherehost }}"
        username: "{{ username }}"
        password: "{{ password }}"
        validate_certs: "{{ validate_certs }}"
        filesystem_id: "{{ filesystem_id }}"
        path: "{{ path }}"
        soft_limit: "{{ soft_limit }}"
        cap_unit: "TB"
        description: "Sample quota tree modified"
        state: "{{ state_present }}"

    - name: Modify quota tree of filesystem by quota tree id
      dellemc.unity.tree_quota:
        unispherehost: "{{ unispherehost }}"
        username: "{{ username }}"
        password: "{{ password }}"
        validate_certs: "{{ validate_certs }}"
        filesystem_name: "{{ filesystem_name }}"
        nas_server_name: "{{ nas_server_name }}"
        tree_quota_id: "{{ tree_quota_id }}"
        soft_limit: "{{ soft_limit }}"
        cap_unit: "TB"
        description: "Sample quota tree modified"
        state: "{{ state_present }}"

    - name: Delete quota tree of filesystem by quota tree path
      dellemc.unity.tree_quota:
        unispherehost: "{{ unispherehost }}"
        username: "{{ username }}"
        password: "{{ password }}"
        validate_certs: "{{ validate_certs }}"
        filesystem_id: "{{ filesystem_id }}"
        path: "{{ path }}"
        state: "{{ state_absent }}"

    - name: Delete quota tree of filesystem -- Idempotency
      dellemc.unity.tree_quota:
        unispherehost: "{{ unispherehost }}"
        username: "{{ username }}"
        password: "{{ password }}"
        validate_certs: "{{ validate_certs }}"
        filesystem_id: "{{ filesystem_id }}"
        path: "{{ path }}"
        state: "{{ state_absent }}"

    - name: Delete quota tree of filesystem by quota tree id
      dellemc.unity.tree_quota:
        unispherehost: "{{ unispherehost }}"
        username: "{{ username }}"
        password: "{{ password }}"
        validate_certs: "{{ validate_certs }}"
        filesystem_id: "{{ filesystem_id }}"
        tree_quota_id: "treequota_171798700679_1"
        state: "{{ state_absent }}"