-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathplaybook-isilonCreateZone.yml
66 lines (63 loc) · 1.86 KB
/
playbook-isilonCreateZone.yml
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
- name: Isilon Create New Access Zone with Ansible URI module
hosts: isilon82DC1
vars:
IsilonIP: "192.168.11.121"
ZoneName: "NewZone"
GrpNetName: "NewGrpNet1"
ifsPath: "/ifs/NewZone"
AuthProvider: "ADS:KRYPTOLULA.LOCAL"
tasks:
- name: get isilon API session IDs
uri:
url: https://{{IsilonIP}}:8080/session/1/session
method: POST
validate_certs: no
body_format: json
body:
{
username: ansible,
password: password01,
services: ["platform", "namespace"]
}
status_code: 201
register: results_login
# - debug:
# msg="{{ results_login }}"
- name: create access zone
uri:
url: https://{{IsilonIP}}:8080/platform/3/zones
method: POST
return_content: no
validate_certs: no
headers:
Cookie: "isisessid={{ results_login.cookies.isisessid }}"
X-CSRF-Token: "{{ results_login.cookies.isicsrf }}"
referer: "https://{{IsilonIP}}:8080"
body_format: json
body:
{
name: "{{ZoneName}}",
groupnet: "{{GrpNetName}}",
path: "{{ifsPath}}",
create_path: true,
auth_providers: [
"{{AuthProvider}}"
]
}
status_code: 201
register: results_zone
- debug:
msg="{{ results_zone }}"
- name: Delete isilon API session IDs
uri:
url: https://{{IsilonIP}}:8080/session/1/session
method: DELETE
validate_certs: no
headers:
Cookie: "isisessid={{ results_login.cookies.isisessid }}"
X-CSRF-Token: "{{ results_login.cookies.isicsrf }}"
referer: "https://{{IsilonIP}}:8080"
status_code: 204
register: results_DEL_cookie
# - debug:
# msg="{{ results_DEL_cookie }}"