trixie/roles/lmn_kde/tasks/main.yml

200 lines
4.8 KiB
YAML
Raw Normal View History

---
- name: Install desktop and educational packages
ansible.builtin.apt:
name:
- akonadi-backend-sqlite
- arduino
- bluefish
- calligra
- codeblocks
- dia
- flameshot
- freecad
- fritzing
- ghex
- gimp
- inkscape
- kde-full
- keepassxc
- librecad
- mu-editor
- openboard
- qtcreator
- spyder
2023-07-12 15:52:09 +02:00
- sqlite3
- sqlitebrowser
- task-german-desktop
- task-german-kde-desktop
- task-kde-desktop
- thonny
- thunderbird-l10n-de
- vlc
- vym
- webext-privacy-badger
- webext-ublock-origin-chromium
- webext-ublock-origin-firefox
- xdg-desktop-portal-kde
- xdg-desktop-portal-wlr # share screen in browser
- xournalpp
autoremove: true
state: latest
- name: Add backports {{ ansible_distribution_release }}
ansible.builtin.apt_repository:
2023-08-16 14:46:55 +02:00
repo: deb http://deb.debian.org/debian/ {{ ansible_distribution_release }}-backports main non-free-firmware
state: present
update_cache: true
- name: Install extra packages from backports
ansible.builtin.apt:
name:
2023-09-07 07:55:53 +02:00
- filius
2023-08-16 14:46:55 +02:00
- kicad
- kicad-doc-de
2023-09-07 07:55:53 +02:00
- libreoffice
- libreoffice-l10n-de
- libreoffice-qt5
state: latest # noqa package-latest
autoremove: true
default_release: "{{ ansible_distribution_release }}-backports"
2023-08-11 18:23:32 +02:00
- name: Create akonadi config dir
ansible.builtin.file:
path: /etc/xdg/akonadi/
state: directory
mode: '0755'
- name: Use sqlite in akonadi
ansible.builtin.blockinfile:
2023-08-11 18:23:32 +02:00
path: /etc/xdg/akonadi/akonadiserverrc
create: true
mode: '0644'
2023-08-11 18:23:32 +02:00
block: |
[%General]
Driver=QSQLITE3
2023-10-19 21:30:25 +02:00
## Akonadi complains if not set:
- name: Add home dirs to apparmor
ansible.builtin.lineinfile:
dest: /etc/apparmor.d/tunables/home.d/ubuntu
line: >-
@{HOMEDIRS}+=/srv/samba/schools/default-school/teachers/
/srv/samba/schools/default-school/students/*/
2023-10-19 21:30:25 +02:00
/srv/samba/schools/default-school/examusers/
2023-08-11 18:23:32 +02:00
- name: Tune SDDM login
ansible.builtin.blockinfile:
path: /etc/sddm.conf
create: true
mode: '0644'
block: |
[Users]
MaximumUid=999
RememberLastUser=false
RememberLastSession=false
2023-10-10 12:36:58 +02:00
- name: Enable wake-on-lan for all ethernet connections
ansible.builtin.copy:
dest: /etc/NetworkManager/conf.d/wake-on-lan.conf
mode: '0644'
2023-10-10 12:36:58 +02:00
content: |
[connection]
ethernet.wake-on-lan=64
- name: Prepare directory for apt-daily override
ansible.builtin.file:
path: /etc/systemd/system/apt-daily.timer.d/
recurse: true
mode: '0755'
state: directory
- name: Run apt update early to avoid outdated package lists
ansible.builtin.copy:
dest: /etc/systemd/system/apt-daily.timer.d/override.conf
mode: '0644'
content: |
[Timer]
RandomizedDelaySec=30m
2023-07-14 13:01:46 +02:00
- name: Create directory to avoid suspend
ansible.builtin.file:
path: /etc/systemd/sleep.conf.d/
state: directory
mode: '0755'
when: "'teacherlaptop' not in group_names"
2023-07-14 13:01:46 +02:00
- name: Avoid suspending
ansible.builtin.blockinfile:
2023-07-14 13:01:46 +02:00
path: /etc/systemd/sleep.conf.d/nosuspend.conf
create: true
mode: '0644'
2023-07-14 13:01:46 +02:00
block: |
[Sleep]
AllowSuspend=no
AllowHibernation=no
AllowSuspendThenHibernate=no
AllowHybridSleep=no
when: "'teacherlaptop' not in group_names"
- name: Deploy dolphin script
ansible.builtin.copy:
src: lmn-fix-dolphin.sh
dest: /usr/local/bin/
mode: '0755'
2023-08-06 13:51:16 +02:00
2023-07-23 11:35:06 +02:00
################# general settings ##################
- name: Enable boot splash screen
ansible.builtin.replace:
dest: "/etc/default/grub"
regexp: '"quiet"$'
replace: '"quiet splash"'
notify: Run update-grub
2024-01-11 17:16:05 +01:00
- name: Protect editing grub menu entries
ansible.builtin.blockinfile:
2023-07-23 11:35:06 +02:00
path: /etc/grub.d/40_custom
block: |
set superusers='root'
2024-01-11 17:16:05 +01:00
export superusers
2023-07-23 11:35:06 +02:00
password_pbkdf2 root {{ grub_pwd }}
2023-07-24 08:25:18 +02:00
notify: Run update-grub
2023-07-23 11:35:06 +02:00
2024-01-11 17:16:05 +01:00
- name: Allow booting grub menu entries
ansible.builtin.lineinfile:
2023-07-23 17:06:08 +02:00
dest: /etc/grub.d/10_linux
line: CLASS="${CLASS} --unrestricted"
insertafter: '^CLASS=.*'
firstmatch: true
2023-07-24 08:25:18 +02:00
notify: Run update-grub
2023-07-23 17:06:08 +02:00
2024-01-12 13:24:14 +01:00
- name: Disable Grub submenus
ansible.builtin.lineinfile:
2024-01-12 13:24:14 +01:00
dest: /etc/default/grub
line: 'GRUB_DISABLE_SUBMENU=true'
insertafter: '^GRUB_TIMEOUT=.*'
2024-01-11 17:16:05 +01:00
notify: Run update-grub
- name: Grub timeout
ansible.builtin.lineinfile:
dest: /etc/default/grub
regexp: '^(GRUB_TIMEOUT=).*'
2024-01-12 13:24:14 +01:00
line: '\g<1>1'
backrefs: true
2023-07-24 08:25:18 +02:00
notify: Run update-grub
- name: Keyboard compose key
ansible.builtin.lineinfile:
dest: /etc/default/keyboard
regexp: '^(XKBOPTIONS=).*'
line: '\1"compose:caps"'
backrefs: true
- name: Default KDE filepicker
ansible.builtin.lineinfile:
path: /etc/environment.d/90lmn-filepicker.conf
create: true
mode: '0644'
line: GTK_USE_PORTAL=1