103
103
description:
104
104
- Specifies whether or not the given path is an externally managed
105
105
mountpoint.
106
-
106
+ namespace:
107
+ required: false
108
+ description:
109
+ - Specifies the Namespace that should be used on PBS
110
+ share:
111
+ required: false
112
+ description:
113
+ - Specifies the CIFS-Share to use
114
+ subdir:
115
+ required: false
116
+ - specifies the folder in the share dir to use for proxmox
117
+ (useful to seperate proxmox content from other content)
118
+ domain:
119
+ required: false
120
+ - Specifies Realm to use for NTLM/LDAPS Authentification if using
121
+ an AD-Enabled share
107
122
author:
108
123
- Fabien Brachere (@fbrachere)
109
124
'''
170
185
datastore: main
171
186
fingerprint: f2:fb:85:76:d2:2a:c4:96:5c:6e:d8:71:37:36:06:17:09:55:f7:04:e3:74:bb:aa:9e:26:85:92:63:c8:b9:23
172
187
encryption_key: autogen
188
+ namespace: Top/something
173
189
- name: Create a ZFS storage type
174
190
proxmox_storage:
175
191
name: zfs1
176
192
type: zfspool
177
193
content: [ "images", "rootdir" ]
178
194
pool: rpool/data
179
195
sparse: true
196
+ - name: CIFS-Share
197
+ proxmox_Storage:
198
+ name: cifs1
199
+ server: cifs-host.domain.tld
200
+ type: cifs
201
+ content: ["snippets", "vztmpl", "iso" ]
202
+ share: sharename
203
+ subdir: /subdir
204
+ username: user
205
+ password: supersecurepass
206
+ domain: addomain.tld
180
207
'''
181
208
182
209
RETURN = '''
@@ -220,7 +247,10 @@ def __init__(self, module):
220
247
self .thinpool = module .params ['thinpool' ]
221
248
self .sparse = module .params ['sparse' ]
222
249
self .is_mountpoint = module .params ['is_mountpoint' ]
223
-
250
+ self .namespace = module .params ['namespace' ]
251
+ self .domain = module .params ['domain' ]
252
+ self .subdir = module .params ['subdir' ]
253
+ self .share = module .params ['share' ]
224
254
# Validate the parameters given to us
225
255
fingerprint_re = re .compile ('^([A-Fa-f0-9]{2}:){31}[A-Fa-f0-9]{2}$' )
226
256
if self .fingerprint is not None and not fingerprint_re .match (self .fingerprint ):
@@ -305,16 +335,26 @@ def prepare_storage_args(self):
305
335
args ['vgname' ] = self .vgname
306
336
if self .thinpool is not None :
307
337
args ['thinpool' ] = self .thinpool
338
+ if self .namespace is not None :
339
+ args ['namespace' ] = self .namespace
308
340
if self .sparse is not None :
309
341
args ['sparse' ] = 1 if self .sparse else 0
310
342
if self .is_mountpoint is not None :
311
343
args ['is_mountpoint' ] = 1 if self .is_mountpoint else 0
312
-
344
+ if self .namespace is not None :
345
+ args ['namespace' ] = self .namespace
346
+ # CIFS
347
+ if self .subdir is not None :
348
+ args ['subdir' ] = self .subdir
349
+ if self .domain is not None :
350
+ args ['domain' ] = self .domain
351
+ # end cifs
313
352
if self .maxfiles is not None and 'backup' not in self .content :
314
353
self .module .fail_json (msg = "maxfiles is not allowed when there is no 'backup' in content" )
315
354
if self .krbd is not None and self .type != 'rbd' :
316
355
self .module .fail_json (msg = "krbd is only allowed with 'rbd' storage type" )
317
-
356
+ if self .share is not None :
357
+ args ['share' ] = self .share
318
358
return args
319
359
320
360
def create_storage (self ):
@@ -386,7 +426,7 @@ def main():
386
426
nodes = dict (type = 'list' , required = False , default = None ),
387
427
type = dict (default = None , type = 'str' , required = True ,
388
428
choices = ["dir" , "nfs" , "rbd" , "lvm" , "lvmthin" , "cephfs" ,
389
- "zfspool" , "btrfs" , "pbs" ]),
429
+ "zfspool" , "btrfs" , "pbs" , "cifs" ]),
390
430
# Remaining PVE API arguments (depending on type) past this point
391
431
datastore = dict (default = None , type = 'str' , required = False ),
392
432
encryption_key = dict (default = None , type = 'str' , required = False ),
@@ -405,7 +445,12 @@ def main():
405
445
vgname = dict (default = None , type = 'str' , required = False ),
406
446
thinpool = dict (default = None , type = 'str' , required = False ),
407
447
sparse = dict (default = None , type = 'bool' , required = False ),
408
- is_mountpoint = dict (default = None , type = 'bool' , required = False ),
448
+ is_mountpoint = dict (default = None , type = 'bool' , required = False ),
449
+ namespace = dict (default = None , type = 'str' , required = False ),
450
+ subdir = dict (default = None , type = 'str' , required = False ),
451
+ domain = dict (default = None , type = 'str' , required = False ),
452
+ share = dict (default = None , type = 'str' , required = False ),
453
+
409
454
)
410
455
411
456
module = AnsibleModule (
@@ -420,7 +465,8 @@ def main():
420
465
["type" , "lvmthin" , ["vgname" , "thinpool" , "content" ]],
421
466
["type" , "zfspool" , ["pool" , "content" ]],
422
467
["type" , "btrfs" , ["path" , "content" ]],
423
- ["type" , "pbs" , ["server" , "username" , "password" , "datastore" ]]
468
+ ["type" , "pbs" , ["server" , "username" , "password" , "datastore" ]],
469
+ ["type" , "cifs" , ["server" , "share" ]],
424
470
],
425
471
required_by = {
426
472
"master_pubkey" : "encryption_key"
0 commit comments