Add an option to force logout if the home on server fails to mount
This commit is contained in:
parent
e5bf6054fe
commit
513d29d628
4 changed files with 550 additions and 508 deletions
|
@ -14,20 +14,50 @@ Nothing
|
||||||
## Activation / Default
|
## Activation / Default
|
||||||
To enable the local home directory, set the variable `localhome` to `true` (default: false).
|
To enable the local home directory, set the variable `localhome` to `true` (default: false).
|
||||||
|
|
||||||
|
## Configuration / Variables
|
||||||
|
|
||||||
|
* **localhome**
|
||||||
|
This flag indicates whether to use home on local disk.
|
||||||
|
If set to `true` local user's home will be on local disk.
|
||||||
|
Type: *Boolean*
|
||||||
|
Values:
|
||||||
|
* `false` <-- (default)
|
||||||
|
* `true`
|
||||||
|
* **localhome_logout_missing_serverhome**
|
||||||
|
If this flag is set to `true`, the user will be logged out if mounting the serverhome failed.
|
||||||
|
Sometimes mounting the server homes fails, but the user still logs in.
|
||||||
|
For laptops used in schools, it's better to force the server home.
|
||||||
|
For teacher devices that can also be used outside of school, this flag must not be set.
|
||||||
|
Type:: *Boolean*
|
||||||
|
Values:
|
||||||
|
* `false`
|
||||||
|
* `true` <-- (default)
|
||||||
|
|
||||||
|
|
||||||
|
localhome_logout_missing_serverhome
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
* Hosts in group `laptops` will get the localhome.
|
* Hosts in group `laptops` will get the localhome. Teacherlaptops will be part of the `laptop` group (children-entry).
|
||||||
* All computers in the desktop group, except the PC with IP address 10.0.2.33, will have their home directory on the network (default).\
|
* All computers in the desktop group, except the PC with IP address 10.0.2.33, will have their home directory on the network (default).\
|
||||||
The PC with IP address 10.0.2.33 also has a local home directory.
|
The PC with IP address 10.0.2.33 also has a local home directory.
|
||||||
* Hosts in group `desktop` will have home on net (default)
|
* Hosts in group `desktop` will have home on net (default).
|
||||||
|
* If mounting the server home fails on a local home device (except for teacher devices), the user is automatically logged out.
|
||||||
|
|
||||||
inventory.yml
|
inventory.yml
|
||||||
```
|
```
|
||||||
laptops:
|
laptops:
|
||||||
hosts:
|
hosts:
|
||||||
10.0.1.[1-64]:
|
10.0.1.[1-64]:
|
||||||
|
children:
|
||||||
|
teacherlaptops
|
||||||
vars:
|
vars:
|
||||||
localhome: true
|
localhome: true
|
||||||
|
teacherlaptops:
|
||||||
|
hosts:
|
||||||
|
10.0.3.[1-32]:
|
||||||
|
vars:
|
||||||
|
localhome_logout_missing_serverhome: false
|
||||||
desktops:
|
desktops:
|
||||||
hosts:
|
hosts:
|
||||||
10.0.2.[1-32]:
|
10.0.2.[1-32]:
|
||||||
|
|
1021
inventory.yml
1021
inventory.yml
File diff suppressed because it is too large
Load diff
|
@ -1,2 +1,3 @@
|
||||||
---
|
---
|
||||||
localhome: false
|
localhome: false
|
||||||
|
localhome_logout_missing_serverhome: true
|
||||||
|
|
|
@ -34,6 +34,6 @@
|
||||||
mode: '0755'
|
mode: '0755'
|
||||||
content: |
|
content: |
|
||||||
[[ "${UID}" -gt 10000 ]] && ! findmnt "/lmn/media/${USER}/home" > /dev/null && exit 0
|
[[ "${UID}" -gt 10000 ]] && ! findmnt "/lmn/media/${USER}/home" > /dev/null && exit 0
|
||||||
{% if 'teacherlaptop' not in group_names %}
|
{% if localhome_logout_missing_serverhome %}
|
||||||
[[ "${UID}" -gt 10000 ]] && ! findmnt /srv/samba/schools/default-school > /dev/null && exit 0
|
[[ "${UID}" -gt 10000 ]] && ! findmnt /srv/samba/schools/default-school > /dev/null && exit 0
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
Loading…
Add table
Reference in a new issue