-
Notifications
You must be signed in to change notification settings - Fork 0
/
retired.yml
259 lines (222 loc) · 7.14 KB
/
retired.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
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
---
- name: Configure my retired X230 Thinkpad
hosts:
- retired
vars:
use_handlers: 'true'
use_reboot: 'false'
use_logout: 'false'
tasks:
- name: Install Swapfile
include_role:
name: swapfilesetup
vars:
swapsizegb: 8
swappath: /swapfile
- name: Install nftables
include_role:
name: nftablesrules
#vars:
# nfinputports_tcp: [ 22 ]
- name: Install docker
include_role:
name: dockersetup
- name: Create services docker network
docker_network:
name: services
- name: Deploy pihole
include_role:
name: piholesetup
- name: Set ssh keys for root account
authorized_key:
user: root
key: "{{rootsshkeys|join('\n')}}"
exclusive: true
- name: Create useraccount
include_role:
name: useraccount
- name: Shell Tools
block:
- name: Install shell tools
package:
name:
- vim
- htop
- curl
- mc
- screen
- git
- ncdu
- wget
- less
- neofetch
- usbutils
- nmap
- wireshark-cli
- mtr
- parted
- dosfstools
- btrfs-progs
- exfatprogs
- ntfs-3g
- xfsprogs
- gpart
- mtools
- unp
- unarj
- unrar
- unzip
- bzip2
- p7zip
- unace
- cpio
- sharutils
- cabextract
- rpmextract
- name: Create vimrc
copy:
dest: /root/.vimrc
owner: root
group: root
mode: u=rw,go=-
content: |
set background=dark
syntax on
set mouse=
- name: Install Self-Signed certificate
include_role:
name: selfsignedcert
- name: Install NGINX
include_role:
name: nginxuserserver
vars:
nginx_userdir: true
nginx_userdir_users: [ "{{username}}" ]
- name: Install X11
include_role:
name: xorgsetup
vars:
xorg_video_driver: "{{ 'vmware' if ansible_product_name == 'VirtualBox' else 'intel' }}"
xorg_handle_lightdm_restart: "{{use_handlers|bool}}"
- name: Install XFCE
include_role:
name: xfcesetup
- name: Install Bluetooth
include_role:
name: bluetoothsetup
- name: Install Pulseaudio
include_role:
name: pulseaudiosetup
- name: Install NetworkManager
include_role:
name: networkmanagersetup
vars:
networkmanager_gui: true
- name: Desktop Tools
block:
- name: Install Desktop Tools
package:
name:
- firefox
- code
- element-desktop
- keepass
- bitwarden
- gimp
- vlc
- virt-viewer
#- nextcloud-client
- libreoffice-still
- libreoffice-still-de
- wireshark-qt
- gparted
- remmina
- libvncserver
- spice-gtk
- freerdp
- name: Check if xfce is running
include_role:
name: xfcestatus
- name: Configure Desktop
block:
- name: Create wallpapers folder
file:
path: "{{useraccount_home}}/Pictures/Wallpapers"
owner: "{{useraccount_uid}}"
group: "{{useraccount_gid}}"
mode: u=rwx,go=rx
state: directory
- name: Copy wallpaper
copy:
src: "files/wallpapers/{{wallpaper}}"
dest: "{{useraccount_home}}/Pictures/Wallpapers/{{wallpaper}}"
owner: "{{useraccount_uid}}"
group: "{{useraccount_gid}}"
mode: u=rwx,go=rx
- name: Apply XFCE settings
include_role:
name: xfceconfig
when: xfcestatus_isrunning
vars:
xfceparameters:
# DISPLAY=:0.0 DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus xfconf-query -c xfce4-desktop -m
- { c: keyboard-layout, p: /Default/XkbDisable, t: bool, v: 'false' }
- { c: keyboard-layout, p: /Default/XkbLayout, t: string, v: "{{xfcekeymap}}" }
- { c: keyboard-layout, p: /Default/XkbVariant, t: string, v: "{{xfcekeymapvariant}}" }
- { c: xfce4-session, p: /shutdown/LockScreen, t: bool, v: 'true' }
- { c: xfce4-power-manager, p: /xfce4-power-manager/lock-screen-suspend-hibernate, t: bool, v: 'true' }
- { c: xfce4-session, p: /general/SaveOnExit, t: bool, v: 'false' }
- { c: xfce4-desktop, p: /backdrop/single-workspace-mode, t: bool, v: 'true' }
- { c: xfce4-panel, p: /panels/panel-1/autohide-behavior, t: uint, v: "1" }
- { c: xfce4-panel, p: /panels/panel-2/autohide-behavior, t: uint, v: "1" }
xfcemonitorsettings:
- { c: xfce4-desktop, p: /backdrop/screenSCREENNUM/monitorMONITORNAME/workspace0/last-image, t: string, v: "{{useraccount_home}}/Pictures/Wallpapers/{{wallpaper}}" }
- { c: xfce4-desktop, p: /backdrop/screenSCREENNUM/monitorMONITORNAME/workspace0/image-style, t: int, v: "3" }
- name: Checkout code projects
block:
- name: Create sourcecode folder
file:
path: "{{useraccount_home}}/source"
mode: u=rwx,go=rx
state: directory
- name: Git checkout slides repo
ansible.builtin.git:
repo: https://git.nerdbridge.de/nerdbridge/slides.git
dest: "{{useraccount_home}}/source/slides"
version: master
update: true
clone: true
- name: Symlink slides folder into webserver folder
ansible.builtin.file:
src: "{{useraccount_home}}/source/slides/public"
dest: "{{useraccount_home}}/public_html/slides"
state: link
become: true
become_user: "{{useraccount_name}}"
- name: Finish Setup
block:
- name: Disable automatic ansible apply service
systemd_service:
name: perrys-ansible-apply
enabled: false
- name: Trigger handlers
ansible.builtin.meta: flush_handlers
- name: Delete XFCE4 sessions
file:
path: /home/{{useraccount_name}}/.cache/sessions
state: absent
- name: Logout
shell:
executable: /usr/bin/bash
cmd: 'xfce4-session-logout -l -f'
become: true
become_user: "{{useraccount_name}}"
environment:
DISPLAY: :0.0
DBUS_SESSION_BUS_ADDRESS: "unix:path=/run/user/{{useraccount_uid}}/bus"
when: xfcestatus_isrunning and (use_logout | bool)
- name: Reboot
shell:
executable: /usr/bin/bash
cmd: reboot
when: use_reboot | bool