Skip to content

Commit 55431aa

Browse files
committed
Fix CIFS authentication & subdir feature
- CIFS authentication bug because no username, password and domain are transmited to proxmoxer. Giving authentication informations resolve the bug. - Subdir feature was not present
1 parent 2bbba25 commit 55431aa

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

plugins/modules/proxmox_storage.py

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,11 @@
121121
- The minimum SMB version to use for.
122122
type: str
123123
required: false
124+
subdir:
125+
description:
126+
- The subdir to be used within the CIFS.
127+
type: str
128+
required: false
124129
dir_options:
125130
description:
126131
- Extended information for adding Directory storage.
@@ -336,6 +341,23 @@ def add_storage(self):
336341
cifs_options = self.module.params.get(f'{storage_type}_options', {})
337342
server = cifs_options.get('server')
338343
share = cifs_options.get('share')
344+
username = cifs_options.get('username')
345+
password = cifs_options.get('password')
346+
smb_version = cifs_options.get('smb_version')
347+
domain = cifs_options.get('domain')
348+
subdir = cifs_options.get('subdir')
349+
350+
if username:
351+
payload['username'] = username
352+
if password:
353+
payload['password'] = password
354+
if smb_version:
355+
payload['smbversion'] = smb_version
356+
if domain:
357+
payload['domain'] = domain
358+
if subdir:
359+
payload['subdir'] = subdir
360+
339361
if not all([server, share]):
340362
self.module.fail_json(msg="CIFS storage requires 'server' and 'share' parameters.")
341363
else:
@@ -495,7 +517,8 @@ def main():
495517
'password': dict(type='str', no_log=True),
496518
'share': dict(type='str'),
497519
'domain': dict(type='str'),
498-
'smb_version': dict(type='str')
520+
'smb_version': dict(type='str'),
521+
'subdir': dict(type='str',)
499522
}),
500523
nfs_options=dict(type='dict', options={
501524
'server': dict(type='str'),

0 commit comments

Comments
 (0)