simplified mounts CIFS shares with credentials

This commit is contained in:
2025-01-31 15:13:41 +01:00
parent 022c1c213c
commit 145de84cd4
+7 -14
View File
@@ -116,31 +116,24 @@ Checkout [Permanent Kerberos with gssproxy and Password Keytab](../basic/gssprox
Remote CIFS mountpoints can be defined as follows:
```
mounter::cifs::def::cifs_mpc2375:
ensure: 'present'
path: '/etc/cifs-utils'
cifs_username: 'allowedWindowsUser'
cifs_password: 'ENC[PKCS7,MIIBeQYJKoZIhvc...]'
mounter::cifs::files:
- 'cifs_mpc2375'
mounter::def::emf:
ensure: 'mounted'
device: '//172.23.75.16/Users'
mountpoint: '/emf/jeol2200fs/k2'
type: 'cifs'
options: 'credentials=/etc/cifs-utils/cifs_mpc2375,uid=35667,gid=35270,forcegid,file_mode=0660,dir_mode=0770'
cifs:
cifs_mpc2375:
username: 'allowedWindowsUser'
password: 'ENC[PKCS7,MIIBeQYJKoZIhvc...]'
mounter::mounts:
- 'emf'
```
In the above example, we need to create a `credentials` file with `mounter::cifs::def::$NAME`_. This file will
be called `cifs_mpc2375` and will be located in `/etc/cifs-utils` and will contain information about the
username and password allowed to mount it.
On the other hand, a mount `emf` with type `cifs` is defined. You should specify in options the location of `credentials` as well as optional parameters.
In the above example, we need to create a `credentials` file with the content below the `cifs` -> `$NAME` parameter. This file will
be called like the key below `cifs` and will be located in `/etc/cifs-utils` and will contain information about the
username and password allowed to mount it. To be used the file needs to be referenced as `credentials=` in the mount options.
## Systemd Automount