-
Notifications
You must be signed in to change notification settings - Fork 2
/
convidat.yml
41 lines (37 loc) · 1.11 KB
/
convidat.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
---
- name: Alta de convidat
action: user name=convidat create_home=no groups=cdrom,dialout append=yes shell=/bin/bash password=""
- name: Edición de /etc/gdm3/PostLogin/Default
blockinfile:
dest: /etc/gdm3/PostLogin/Default
create: yes
owner: root
group: root
mode: 755
block: |
# Usuari convidat
guestuser='convidat'
if [ $USER = $guestuser ]
then
# Se borra el directorio por si ha quedado desde la última sesión
[ -d /home/$guestuser ] && rm -rf /home/$guestuser
# Se recrea el directorio
mkdir /home/$guestuser
cp -r /etc/skel/.* /home/$guestuser
mkdir /home/$guestuser/.config
echo 'yes' > /home/$guestuser/.config/gnome-initial-setup-done
chown -R $guestuser:$guestuser /home/$guestuser
fi
- name: Edición de /etc/gdm3/PostSession/Default
blockinfile:
dest: /etc/gdm3/PostSession/Default
owner: root
group: root
mode: 755
insertafter: '^#!/bin/sh$'
block: |
guestuser='convidat'
if [ $USER = $guestuser ]
then
rm -rf /home/$guestuser
fi