Provide a local guest user.
This commit is contained in:
parent
ee85c41483
commit
e48c761935
7 changed files with 151 additions and 97 deletions
28
roles/lmn_localuser/tasks/main.yml
Normal file
28
roles/lmn_localuser/tasks/main.yml
Normal file
|
@ -0,0 +1,28 @@
|
|||
---
|
||||
- name: Mount tmpfs on /home/{{ localuser }}
|
||||
ansible.posix.mount:
|
||||
name: /home/{{ localuser }}
|
||||
src: tmpfs
|
||||
fstype: tmpfs
|
||||
opts: uid=1001,gid=1001,mode=755,size=4G
|
||||
state: mounted
|
||||
|
||||
- name: Add local guest user
|
||||
ansible.builtin.user:
|
||||
name: "{{ localuser }}"
|
||||
comment: "Local Guest User,,,"
|
||||
shell: /bin/bash
|
||||
uid: 1001
|
||||
password_expire_min: 99999
|
||||
createhome: false
|
||||
password: "{{ localuser_pwd }}"
|
||||
|
||||
- name: Prepare generator for local guest user
|
||||
ansible.builtin.copy:
|
||||
dest: /etc/systemd/user-environment-generators/60-guest-user.sh
|
||||
content: |
|
||||
#!/usr/bin/bash
|
||||
set -eu
|
||||
[[ "$UID" -ne 1001 ]] && exit 0
|
||||
cp -r -n /etc/skel/.* "$HOME"
|
||||
mode: "0755"
|
Loading…
Add table
Add a link
Reference in a new issue