Make playbook more general: Split into general and specific roles, use variables.

This commit is contained in:
Andreas B. Mundt 2023-09-02 15:46:27 +02:00
parent c59fb67ed0
commit 431acebfa3
13 changed files with 247 additions and 144 deletions

View file

@ -1,74 +1,39 @@
---
- name: Preseed wireshark to allow users sniffing packets
ansible.builtin.debconf:
name: wireshark-common
question: wireshark-common/install-setuid
value: 'true'
vtype: boolean
- name: Preseed ttf-mscorefonts-installer
ansible.builtin.debconf:
name: ttf-mscorefonts-installer
question: msttcorefonts/dlurl
value: http://livebox.pn.steinbeis.schule/mscorefonts/
vtype: string
- name: Install desktop EDU packages and some more
- name: Install desktop and educational packages
apt:
name:
- task-kde-desktop
- task-german-kde-desktop
- task-german-desktop
- xdg-desktop-portal-kde
- xdg-desktop-portal-wlr # share screen in browser
- kde-full
- akonadi-backend-sqlite
- thunderbird-l10n-de
- webext-privacy-badger
- webext-ublock-origin-firefox
- webext-ublock-origin-chromium
- atftp
- emacs
- elpa-magit
- elpa-color-theme-modern
- vlc
- arduino
- bluefish
- codeblocks
- dia
- flameshot
- freecad
- ghex
- gimp
- inkscape
- flameshot
- bluefish
- git
- gitk
- gitg
- wireshark
- nmap
- netcat-openbsd
- net-tools
- ghex
- thonny
- spyder
- kde-full
- keepassxc
- librecad
- mu-editor
- dia
- vym
- tree
- qtcreator
- spyder
- sqlite3
- sqlitebrowser
- neovim
- qtcreator
- freecad
- librecad
- arduino
- keepassxc
- tmux
- curl
- pulseview
- sigrok
- sigrok-cli
- codeblocks
- ttf-mscorefonts-installer
- 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
autoremove: true
state: latest
environment:
http_proxy: '' # this is needed to avoid ttf-mscorefonts-installer picking up aptcacher
- name: Add {{ ansible_distribution_release }}-backports
apt_repository:
@ -88,14 +53,6 @@
default_release: "{{ ansible_distribution_release }}-backports"
- name: Enable splash screen
replace:
dest: "/etc/default/grub"
regexp: '"quiet"$'
replace: '"quiet splash"'
notify: Run update-grub
- name: Create akonadi config dir
ansible.builtin.file:
path: /etc/xdg/akonadi/
@ -111,12 +68,6 @@
Driver=QSQLITE3
- name: Allow users to dump packets for wireshark without group membership
ansible.builtin.file:
path: /usr/bin/dumpcap
mode: '0755'
- name: Add home dirs to apparmor
lineinfile:
dest: /etc/apparmor.d/tunables/home.d/ubuntu
@ -125,24 +76,6 @@
/srv/samba/schools/default-school/students/*/
- name: Create firefox policies directory
ansible.builtin.file:
path: /etc/firefox-esr/policies
state: directory
mode: '0755'
- name: Create a symbolic link firefox to firefox-esr
ansible.builtin.file:
src: /etc/firefox-esr
dest: /etc/firefox
state: link
- name: copy policy
ansible.builtin.copy:
src: policies.json
dest: /etc/firefox-esr/policies/
- name: tune SDDM login
blockinfile:
path: /etc/sddm.conf
@ -172,35 +105,14 @@
AllowHybridSleep=no
- name: Copy pwroff script
copy:
src: pwroff
dest: /usr/local/sbin/
mode: 0755
- name: Provide service and timer for pwroff script
copy:
src: "{{ item }}"
dest: "/etc/systemd/system/{{ item }}"
mode: 0644
with_items:
- pwroff.service
- pwroff.timer
notify: enable pwroff.timer
- name: copy lmn-reset-dolphin.sh
ansible.builtin.copy:
src: lmn-reset-dolphin.sh
dest: /usr/local/bin/
mode: 0755
- name: Copy fvs-config.js to configure plasma
ansible.builtin.copy:
src: fvs-config.js
dest: /usr/share/plasma/shells/org.kde.plasma.desktop/contents/updates/fvs-config.js
mode: 0644
################# general settings ##################
- name: Enable boot splash screen
replace:
dest: "/etc/default/grub"
regexp: '"quiet"$'
replace: '"quiet splash"'
notify: Run update-grub
- name: Protect grub menu entries
blockinfile:
path: /etc/grub.d/40_custom