-
Notifications
You must be signed in to change notification settings - Fork 5
/
setup.yaml
273 lines (226 loc) · 6 KB
/
setup.yaml
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
---
- name: SSH
hosts: all
tags: ssh
roles:
- role: ssh
vars:
ssh_keys:
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEm981GRiUIsp8e4bTDv+d9SyHfQ8P18W5oovgmAfnip em@x210
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDqmyaaIqRU9hx8PxRnIqe/pRANIxrEEscuMWrHZF1yh snowflake@flakeX230
- name: General
hosts: all
tags: general
tasks:
- name: Install services
community.general.xbps:
name:
- avahi
- chrony
state: present
- name: Enable services
community.general.runit:
name: '{{ item }}'
enabled: true
state: started
loop:
- avahi-daemon
- chronyd
- name: Disable unneeded services
community.general.runit:
name: '{{ item }}'
enabled: false
state: stopped
loop:
- wpa_supplicant
- name: Users
hosts: all
tags: users
tasks:
- name: Set bash as default shell for root
user:
name: root
shell: /bin/bash
- name: User student
user:
name: student
password: $6$7Z.h8Q6CO9AevdIp$8W2nuvD7ZqeXBO.Azsayx2tJ4L0KD44hOz5aNzpGPN/hUtaROvmY7aJ0x7Ie3CPawp6lV4ln2fHQQ7V5Yuy7k0
groups:
# Arduino serial access
- dialout
state: present
- name: Lock bash configuration files for student
# Can be removed after LDAP setup
file:
path: '{{ item }}'
owner: root
group: root
mode: 0644
state: touch
loop:
- /home/student/.bashrc
- /home/student/.bash_profile
- name: Disable SSH for user student
ansible.builtin.lineinfile:
path: "/etc/ssh/sshd_config"
line: "DenyUsers student"
create: true
- name: Software
hosts: all
tags: software
tasks:
- name: Add non-free repository
community.general.xbps:
name: void-repo-nonfree
state: present
- name: Upgrade all packages
community.general.xbps:
upgrade: true
- name: Install common packages
community.general.xbps:
name: '{{ xbps_install }}'
state: present
when: xbps_install
- name: Install video drivers
community.general.xbps:
name:
- mesa-dri
- vulkan-loader
- mesa-vulkan-radeon
- amdvlk
- xf86-video-amdgpu
- mesa-vaapi
- mesa-vdpau
- intel-video-accel
- mesa-vulkan-intel
- name: Recursively remove packages
community.general.xbps:
name: '{{ xbps_remove }}'
state: absent
recurse: true
when: xbps_remove
- name: Clear xbps cache
command: 'xbps-remove -O'
- name: Purge old kernels
command: 'vkpurge rm all'
- name: Gnome
hosts: all
tags:
- gnome
- software
handlers:
- name: Update dconf database
command: 'dconf update'
tasks:
- name: Install Gnome
community.general.xbps:
name:
- dbus
- gnome
- gdm
- xorg # Prevents a crash on some systems
- mesa-vdpau
- mesa-vaapi
- pipewire
state: present
- name: Enable services
community.general.runit:
name: '{{ item }}'
enabled: true
state: started
loop:
- dbus
- gdm
- name: Copy session cleanup script
copy:
src: 'files/session-cleanup.sh'
dest: '/etc/gdm/PostSession/Default'
mode: '0755'
- name: Enable autologin
copy:
src: 'files/desktop/autologin'
dest: '/etc/gdm/custom.conf'
notify: Update dconf database
- name: Ensure directories exist
file:
path: '{{item}}'
state: directory
loop:
- /etc/dconf/db/local.d
- /etc/dconf/db/local.d/locks
- name: Create user profile
copy:
src: 'files/desktop/profile/user'
dest: '/etc/dconf/profile/user'
- name: Copy configuration files
copy:
src: 'files/desktop/main'
dest: '/etc/dconf/db/local.d/main'
notify: Update dconf database
- name: Set screen timeout
template:
src: 'files/desktop/screensaver'
dest: '/etc/dconf/db/local.d/screensaver'
notify: Update dconf database
- name: PipeWire
hosts: all
tags: pipewire
tasks:
- name: Install PipeWire
community.general.xbps:
name:
- pipewire
- wireplumber
state: present
- name: Ensure configuration directories exist
file:
path: '/etc/pipewire/pipewire.conf.d/'
state: directory
- name: Copy PipeWire configuration
copy:
src: '{{ item.src }}'
dest: '{{ item.dest }}'
loop:
- src: 'files/pipewire/pipewire.conf'
dest: '/etc/pipewire/pipewire.conf'
- src: 'files/pipewire/10-wireplumber.conf'
dest: '/etc/pipewire/pipewire.conf.d/10-wireplumber.conf'
- name: Symlink PipeWire to autostart
file:
src: '{{ item.src }}'
dest: '{{ item.dest }}'
state: link
loop:
- src: '/usr/share/applications/pipewire.desktop'
dest: '/etc/xdg/autostart/pipewire.desktop'
- src: '/usr/share/applications/pipewire-pulse.desktop'
dest: '/etc/xdg/autostart/pipewire-pulse.desktop'
- name: GRUB
hosts: all
tags: grub
handlers:
- name: grub-mkconfig
command: 'grub-mkconfig -o /boot/grub/grub.cfg'
tasks:
- name: Copy GRUB configuration
template:
src: 'files/grub/grub'
dest: '/etc/default/grub'
notify: grub-mkconfig
- name: Firefox
hosts: all
tasks:
- name: Ensure Firefox extensions folder exists
file:
path: "/usr/lib64/firefox/distribution/extensions"
state: directory
- name: Install firefox extensions
copy:
src: "{{ item }}"
dest: "/usr/lib64/firefox/distribution/extensions/"
loop:
- "files/firefox/[email protected]"
- name: Bakaláři
hosts: teachers
roles:
- bakalari