|
121 | 121 | - The minimum SMB version to use for. |
122 | 122 | type: str |
123 | 123 | required: false |
| 124 | + subdir: |
| 125 | + description: |
| 126 | + - The subdir to be used within the CIFS. |
| 127 | + type: str |
| 128 | + required: false |
124 | 129 | dir_options: |
125 | 130 | description: |
126 | 131 | - Extended information for adding Directory storage. |
@@ -336,6 +341,23 @@ def add_storage(self): |
336 | 341 | cifs_options = self.module.params.get(f'{storage_type}_options', {}) |
337 | 342 | server = cifs_options.get('server') |
338 | 343 | 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 | + |
339 | 361 | if not all([server, share]): |
340 | 362 | self.module.fail_json(msg="CIFS storage requires 'server' and 'share' parameters.") |
341 | 363 | else: |
@@ -495,7 +517,8 @@ def main(): |
495 | 517 | 'password': dict(type='str', no_log=True), |
496 | 518 | 'share': dict(type='str'), |
497 | 519 | 'domain': dict(type='str'), |
498 | | - 'smb_version': dict(type='str') |
| 520 | + 'smb_version': dict(type='str'), |
| 521 | + 'subdir': dict(type='str',) |
499 | 522 | }), |
500 | 523 | nfs_options=dict(type='dict', options={ |
501 | 524 | 'server': dict(type='str'), |
|
0 commit comments