-
Notifications
You must be signed in to change notification settings - Fork 2
/
tesla-u1804.yml
126 lines (106 loc) · 3.74 KB
/
tesla-u1804.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
---
- hosts: tesla
user: root
vars:
grupos: adm,cdrom,dialout,kvm,libvirt,lpadmin,lxd,plugdev,sambashare,ubridge,vboxusers
handlers:
- name: restart sshd
service:
name: sshd
state: restarted
- name: configure br0
blockinfile:
dest: /etc/network/interfaces
block: |
# Puente br0 para lxd y kvm
auto {{ ansible_default_ipv4.interface }}
iface {{ ansible_default_ipv4.interface }} inet manual
auto br0
iface br0 inet dhcp
bridge_ports {{ ansible_default_ipv4.interface }}
- name: configure lxd0
command: systemctl restart networking
- name: configure lxd1
command: lxc storage create pool dir
- name: configure lxd2
command: lxc profile device add default root disk path=/ pool=pool
- name: configure lxd3
command: lxc network attach-profile br0 default
- name: dconf update
command: dconf update
tasks:
# Tareas por defecto
- include: default.yml
# Cambio de hostname
- include: /home/vcarceler/playbooks/cambia-hostname.yml base_hostname=tesla
# Cambio en la configuración de sshd para bloquear la autenticación con password
- name: Bloquea la autenticación con password en /etc/ssh/sshd_config
replace:
dest: /etc/ssh/sshd_config
regexp: '^#PasswordAuthentication yes'
replace: 'PasswordAuthentication no'
notify:
- restart sshd
# Tareas particulares de las aulas de informática
- include: apagado-1455.yml
# Tareas generales de informática (DPT y Aulas)
#
# Borrado de usuarios por defecto (mati y tarda)
- include: del-default-users.yml
# Usuario invitado
- include: convidat.yml
# Gnome3 dconf
- include: gnome3-dconf.yml
# Instalación general de paquetes para Informàtica (DPT y Aulas)
- include: informatica-paquetes-u1804.yml
# Solo para este aula
- name: Instala snap android-studio
snap:
name: android-studio
classic: yes
- name: Instala snap dotnet-sdk
snap:
name: dotnet-sdk
classic: yes
# Configura LXD
- name: Instala bridge-utils y LXD
action: apt pkg={{ item }} state=present
with_items:
- bridge-utils
- lxd
# Comprueba que no esté configurado LXD para no destrozar /etc/network/interfaces
# en la segunda ejecución, al ser la interfaz principal br0
- name: Comprueba si es necesario configurar el puente br0 en /etc/network/interfaces
lineinfile:
dest: /etc/network/interfaces
line: '# LXD configurado'
notify:
- configure br0
- configure lxd0
- configure lxd1
- configure lxd2
- configure lxd3
# Usuarios
- include: users/dam2a.yml
- include: users/esobat/grupos/inf-fiv.yml
- include: users/esobat/grupos/inf-fiii.yml
- include: users/esobat/grupos/tec2-fi.yml
- include: users/esobat/grupos/tec2-fii.yml
- include: users/esobat/grupos/tec3a-g1.yml
- include: users/esobat/grupos/tec3a-g2.yml
- include: users/esobat/grupos/tec3b-g1.yml
- include: users/esobat/grupos/tec3b-g2.yml
- include: users/esobat/grupos/tec3c-g1.yml
- include: users/esobat/grupos/tec3c-g2.yml
- include: users/esobat/grupos/tec3d-g1.yml
- include: users/esobat/grupos/tec3d-g2.yml
- include: users/esobat/grupos/tec3e-g1.yml
- include: users/esobat/grupos/tec3e-g2.yml
#- include: users/esobat/3a.yml
#- include: users/esobat/3b.yml
#- include: users/esobat/3c.yml
#- include: users/esobat/3d.yml
#- include: users/esobat/2inf-1.yml
#- include: users/esobat/2inf-2.yml
#- include: users/esobat/inf-fi.yml
#- include: users/esobat/inf-fiii.yml