|
1 | | -# Title: create_volume_and_share.yaml |
| 1 | +# Title: delete_volume_and_share.yaml |
2 | 2 |
|
3 | 3 | --- |
4 | | -- name: Playbook to create a volume and a CIFS share that points to it on an FSx for ONTAP file system. |
| 4 | +- name: Playbook to delete a volume and a CIFS share that points to it on an FSx for ONTAP file system. |
5 | 5 | hosts: localhost |
6 | 6 | collections: |
7 | 7 | - netapp.ontap |
|
19 | 19 | when: vars[item] is undefined |
20 | 20 | loop: |
21 | 21 | - volume_name |
22 | | - - volume_size |
23 | 22 | - vserver |
24 | 23 | - secret_name |
| 24 | + - fsxn_hostname |
25 | 25 | # |
26 | 26 | # Give default values to optional variables if they are not defined |
27 | 27 | - name: Set security_style to ntfs if not provide. |
|
80 | 80 | password: "{{ lookup('amazon.aws.aws_secret', '{{ secret_name }}.password', nested=true) }}" |
81 | 81 | no_log: true |
82 | 82 |
|
83 | | - - name: Create the volume |
84 | | - netapp.ontap.na_ontap_volume: |
| 83 | + - name: Delete CIFS Share |
| 84 | + netapp.ontap.na_ontap_cifs: |
85 | 85 | state: absent |
86 | | - name: "{{ volume_name }}" |
87 | | - size: "{{ volume_size }}" |
| 86 | + name: "{{ share_name }}" |
| 87 | + path: "{{ junction_path }}" |
88 | 88 | vserver: "{{ vserver }}" |
89 | | - aggregate_name: "{{ aggr }}" |
90 | | - junction_path: "{{ junction_path }}" |
91 | | - volume_security_style: "{{ security_style }}" |
92 | 89 | use_lambda: "{{ use_lambda }}" |
93 | 90 | lambda_config: |
94 | 91 | aws_profile: "{{ aws_profile }}" |
95 | 92 | aws_region: "{{ aws_region }}" |
96 | 93 | function_name: "{{ lambda_function_name }}" |
97 | | - type: "{{ volume_type }}" |
98 | | - size_unit: "mb" |
99 | 94 | hostname: "{{ fsxn_hostname }}" |
100 | 95 | username: "{{ username }}" |
101 | 96 | password: "{{ password }}" |
102 | 97 | validate_certs: false |
103 | 98 |
|
104 | | - - name: Create CIFS Share |
105 | | - netapp.ontap.na_ontap_cifs: |
| 99 | + - name: Delete the volume |
| 100 | + netapp.ontap.na_ontap_volume: |
106 | 101 | state: absent |
107 | | - name: "{{ share_name }}" |
108 | | - path: "{{ junction_path }}" |
| 102 | + name: "{{ volume_name }}" |
109 | 103 | vserver: "{{ vserver }}" |
| 104 | + aggregate_name: "{{ aggr }}" |
110 | 105 | use_lambda: "{{ use_lambda }}" |
111 | 106 | lambda_config: |
112 | 107 | aws_profile: "{{ aws_profile }}" |
|
0 commit comments