-
Notifications
You must be signed in to change notification settings - Fork 4
/
playbook-isilonSMB-share.yml
136 lines (130 loc) · 4.16 KB
/
playbook-isilonSMB-share.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
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
- name: Isilon New SMB share domain group permissions with ansible URI module
#hosts: isilon82DC1
hosts: isilon822dc1
vars:
Isilon_IP: "https://192.168.21.141:8080"
isilonuser: "ansible"
isilonpass: "ansible"
Isilon_zone: "system"
sharename: "API SMB Ansible Share"
sharepath: /ifs/data/Ansible
sharedescr: "Share Created by Ansible Core Isilon API playbook"
domaingrp: "KRYPTOLULA\\domain users"
tasks:
- name: get isilon API session IDs
uri:
url: "{{ Isilon_IP }}/session/1/session"
method: POST
validate_certs: no
body_format: json
body:
{
username: "{{ isilonuser }}",
password: "{{ isilonpass }}",
services: ["platform", "namespace"]
}
status_code: 201
register: results_login
- debug:
msg="{{ results_login }}"
- name: make SMB share
uri:
url: "{{ Isilon_IP }}/platform/4/protocols/smb/shares"
method: POST
return_content: no
validate_certs: no
headers:
Cookie: "isisessid={{ results_login.cookies.isisessid }}"
X-CSRF-Token: "{{ results_login.cookies.isicsrf }}"
referer: "{{ Isilon_IP }}"
body_format: json
body:
{
ntfs_acl_support: true,
create_permissions: "default acl",
name: "{{ sharename }}",
path: "{{ sharepath }}",
description: "{{ sharedescr }}",
browsable: true,
zone: "{{ Isilon_zone }}",
create_path: true,
permissions: [
{
permission: "full",
permission_type: "allow",
trustee:
{
name: "{{ domaingrp }}",
type: "group"
}
} ]
}
status_code: 201
register: results_cookie
# - debug:
# msg="{{ results_cookie }}"
########################################################################################
##### RAN user requires read access to access point on Isilon
##### E.g. chmod -R +a user ansible allow dir_gen_all,delete_child,object_inherit,container_inherit,file_gen_all,add_file,add_subdir /ifs
########################################################################################
- name: Apply Directory permissions via namespace API
uri:
# url: "{{ Isilon_IP }}/namespace{{ sharepath }}/?acl&nsaccess=true"
url: "{{ Isilon_IP }}/namespace{{ sharepath }}?acl"
method: PUT
return_content: no
validate_certs: no
headers:
Cookie: "isisessid={{ results_login.cookies.isisessid }}"
X-CSRF-Token: "{{ results_login.cookies.isicsrf }}"
x-isi-ifs-target-type: "container"
referer: "{{ Isilon_IP }}"
body_format: json
body:
{
group:
{
name: "{{ domaingrp }}",
type: "group"
},
authoritative: acl,
action: update,
acl: [
{
trustee:
{
name: "{{ domaingrp }}",
type: "group"
},
accesstype: "allow",
accessrights: [
"dir_gen_read",
"dir_gen_write",
"dir_gen_execute",
"std_write_dac",
"delete_child"
],
inherit_flags: [
"object_inherit",
"container_inherit"
],
op: "add"
} ]
}
status_code: 200
register: results_permission
- debug:
msg="{{ results_permission }}"
- name: Delete isilon API session IDs
uri:
url: "{{ Isilon_IP }}/session/1/session"
method: DELETE
validate_certs: no
headers:
Cookie: "isisessid={{ results_login.cookies.isisessid }}"
X-CSRF-Token: "{{ results_login.cookies.isicsrf }}"
referer: "{{ Isilon_IP }}"
status_code: 204
register: results_DEL_cookie
# - debug:
# msg="{{ results_DEL_cookie }}"