Compare commits
No commits in common. "6f1827ff005cf4cbfeb2137c1a0807edcc486fa2" and "fb98d53fad342add0c2a5527e13b1e9ac5fdd365" have entirely different histories.
6f1827ff00
...
fb98d53fad
14 changed files with 67 additions and 50 deletions
|
|
@ -30,10 +30,6 @@
|
||||||
"url": "https://info.steinbeis.schule",
|
"url": "https://info.steinbeis.schule",
|
||||||
"name": "FvS-Hilfesystem"
|
"name": "FvS-Hilfesystem"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"url": "https://ticket.steinbeis.schule",
|
|
||||||
"name": "FvS-IT-Support"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"url": "https://moodle.steinbeis.schule",
|
"url": "https://moodle.steinbeis.schule",
|
||||||
"name": "FvS-Moodle"
|
"name": "FvS-Moodle"
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,6 @@
|
||||||
- net-tools
|
- net-tools
|
||||||
- netcat-openbsd
|
- netcat-openbsd
|
||||||
- nmap
|
- nmap
|
||||||
- octave
|
|
||||||
- okular-extra-backends ## needed for CHM files
|
- okular-extra-backends ## needed for CHM files
|
||||||
- pdf-presenter-console
|
- pdf-presenter-console
|
||||||
- php-cli
|
- php-cli
|
||||||
|
|
|
||||||
|
|
@ -22,8 +22,8 @@ fi
|
||||||
pactl set-card-profile alsa_card.{{ audio_output[0] }} output:{{ audio_output[1] }}
|
pactl set-card-profile alsa_card.{{ audio_output[0] }} output:{{ audio_output[1] }}
|
||||||
pactl set-default-sink alsa_output.{{ audio_output[0] }}.{{ audio_output[1] }}
|
pactl set-default-sink alsa_output.{{ audio_output[0] }}.{{ audio_output[1] }}
|
||||||
{% else %}
|
{% else %}
|
||||||
if pactl list cards | grep output:hdmi-stereo: | grep -E "verfügbar: ja|available: yes"; then
|
if pactl list cards | grep output:hdmi-stereo: | grep verfügbar:\ ja; then
|
||||||
pactl set-card-profile $(pactl list short cards | grep -m1 pci | head -1 | cut -f2) output:hdmi-stereo
|
pactl set-card-profile $(pactl list short cards | grep -m1 pci | head -1 | cut -f2) output:hdmi-stereo
|
||||||
pactl set-default-sink $(pactl list short cards | grep -m1 pci | head -1 | cut -f2 | sed s/card/output/g).hdmi-stereo
|
pactl set-default-sink $(pactl list short cards | grep -m1 pci | head -1 | cut -f2 | sed s/card/output/g).output:hdmi-stereo
|
||||||
fi
|
fi
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
||||||
|
|
@ -5,5 +5,5 @@ Description=Run LMN Client updates via ansible-pull
|
||||||
Type=oneshot
|
Type=oneshot
|
||||||
User=root
|
User=root
|
||||||
ExecStart=/usr/bin/ansible-pull --only-if-changed --verbose --vault-password-file /root/.inventory-pw -l %H -d /root/lmn-client \
|
ExecStart=/usr/bin/ansible-pull --only-if-changed --verbose --vault-password-file /root/.inventory-pw -l %H -d /root/lmn-client \
|
||||||
--skip-tags no_ansible_pull -i {{ misc_updater_inventory }} --url={{ misc_updater_repository }} -C {{ misc_updater_branch }} lmn-client.yml
|
-i {{ misc_updater_inventory }} --url={{ misc_updater_repository }} -C {{ misc_updater_branch }} lmn-client.yml
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,7 @@
|
||||||
ansible.posix.mount:
|
ansible.posix.mount:
|
||||||
src: "{{ nfs_server }}:tools"
|
src: "{{ nfs_server }}:tools"
|
||||||
path: /lmn/tools
|
path: /lmn/tools
|
||||||
opts: rw,_netdev,x-systemd.automount,x-systemd.idle-timeout=10s,x-systemd.mount-timeout=10,timeo=100,soft
|
opts: rw,_netdev,x-systemd.automount,x-systemd.idle-timeout=10s,timeo=100,soft
|
||||||
state: present
|
state: present
|
||||||
fstype: nfs4
|
fstype: nfs4
|
||||||
when: nfs_server is defined
|
when: nfs_server is defined
|
||||||
|
|
|
||||||
|
|
@ -32,29 +32,3 @@
|
||||||
state: absent
|
state: absent
|
||||||
purge: true
|
purge: true
|
||||||
autoremove: true
|
autoremove: true
|
||||||
|
|
||||||
# CVE-2026-31431 https://copy.fail/#mitigation
|
|
||||||
- name: Create modprobe config to disable algif_aead
|
|
||||||
ansible.builtin.lineinfile:
|
|
||||||
path: /etc/modprobe.d/disable-algif.conf
|
|
||||||
line: "install algif_aead /bin/false"
|
|
||||||
create: true
|
|
||||||
mode: '0644'
|
|
||||||
|
|
||||||
- name: Remove algif_aead module if loaded
|
|
||||||
community.general.modprobe:
|
|
||||||
name: algif_aead
|
|
||||||
state: absent
|
|
||||||
|
|
||||||
# Dirty.Frag
|
|
||||||
- name: Create modprobe config to disable modules needed for dirty.frag
|
|
||||||
ansible.builtin.copy:
|
|
||||||
dest: /etc/modprobe.d/dirtyfrag.conf
|
|
||||||
content: |
|
|
||||||
install esp4 /bin/false
|
|
||||||
install esp6 /bin/false
|
|
||||||
install rxrpc /bin/false
|
|
||||||
mode: '0644'
|
|
||||||
|
|
||||||
- name: Set VM permissions
|
|
||||||
ansible.builtin.command: chmod -R o+r /lmn/vm
|
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,11 @@ lmnsynci ALL=(root) NOPASSWD: /usr/local/bin/vm-aria2
|
||||||
%role-student ALL=(root) NOPASSWD: /usr/local/bin/vm-link-images
|
%role-student ALL=(root) NOPASSWD: /usr/local/bin/vm-link-images
|
||||||
%role-teacher ALL=(root) NOPASSWD: /usr/local/bin/vm-link-images
|
%role-teacher ALL=(root) NOPASSWD: /usr/local/bin/vm-link-images
|
||||||
|
|
||||||
|
# vm-virtiofsd: Start Virtiofsd as systemd-service
|
||||||
|
%examusers ALL=(root) NOPASSWD: /usr/local/bin/vm-virtiofsd
|
||||||
|
%role-student ALL=(root) NOPASSWD: /usr/local/bin/vm-virtiofsd
|
||||||
|
%role-teacher ALL=(root) NOPASSWD: /usr/local/bin/vm-virtiofsd
|
||||||
|
|
||||||
# desktop-sync:
|
# desktop-sync:
|
||||||
%examusers ALL=(root) NOPASSWD: /usr/local/bin/desktop-sync
|
%examusers ALL=(root) NOPASSWD: /usr/local/bin/desktop-sync
|
||||||
%role-student ALL=(root) NOPASSWD: /usr/local/bin/desktop-sync
|
%role-student ALL=(root) NOPASSWD: /usr/local/bin/desktop-sync
|
||||||
|
|
|
||||||
BIN
roles/lmn_vm/files/virtiofsd
Executable file
BIN
roles/lmn_vm/files/virtiofsd
Executable file
Binary file not shown.
|
|
@ -125,6 +125,8 @@ create_clone() {
|
||||||
|
|
||||||
create_printerlist() {
|
create_printerlist() {
|
||||||
## Prepare .printerlist.csv
|
## Prepare .printerlist.csv
|
||||||
|
mkdir -p "${VM_MEDIADIR}"
|
||||||
|
chgrp "$(id -g)" "${VM_MEDIADIR}"
|
||||||
echo "Name;IppURL" > "${VM_MEDIADIR}/.printerlist.csv"
|
echo "Name;IppURL" > "${VM_MEDIADIR}/.printerlist.csv"
|
||||||
for p in $(lpstat -v | cut -f 3 -d" " | sed 's/:$//'); do
|
for p in $(lpstat -v | cut -f 3 -d" " | sed 's/:$//'); do
|
||||||
echo "$p;ipp://192.168.122.1/printers/$p" >> "${VM_MEDIADIR}/.printerlist.csv"
|
echo "$p;ipp://192.168.122.1/printers/$p" >> "${VM_MEDIADIR}/.printerlist.csv"
|
||||||
|
|
@ -147,7 +149,7 @@ start_virtiofs_service() {
|
||||||
local drive_letter=$3
|
local drive_letter=$3
|
||||||
local socket="/run/user/${UID}/virtiofs-${VM_NAME}-${target_name,,}.sock"
|
local socket="/run/user/${UID}/virtiofs-${VM_NAME}-${target_name,,}.sock"
|
||||||
|
|
||||||
systemd-run --user /usr/lib/qemu/virtiofsd --uid-map=":${GUEST_UID}:${UID}:1:" --gid-map=":${GUEST_GID}:$(id -g):1:" \
|
systemd-run --user /usr/local/bin/virtiofsd --uid-map=":${GUEST_UID}:${UID}:1:" --gid-map=":${GUEST_GID}:$(id -g):1:" \
|
||||||
--socket-path "${socket}" --shared-dir "${shared_dir}" --syslog
|
--socket-path "${socket}" --shared-dir "${shared_dir}" --syslog
|
||||||
|
|
||||||
if [[ $? -ne 0 ]]; then
|
if [[ $? -ne 0 ]]; then
|
||||||
|
|
@ -206,7 +208,6 @@ EOF
|
||||||
|
|
||||||
QEMU='qemu:///session'
|
QEMU='qemu:///session'
|
||||||
|
|
||||||
|
|
||||||
NEWCLONE=0
|
NEWCLONE=0
|
||||||
PERSISTENT=0
|
PERSISTENT=0
|
||||||
LIBVIRTOSINFO="win10"
|
LIBVIRTOSINFO="win10"
|
||||||
|
|
@ -360,8 +361,6 @@ if ! virsh --connect="${QEMU}" list | grep "${VM_NAME}-clone"; then
|
||||||
else
|
else
|
||||||
VMINFO_DIR="/lmn/media/${USER}"
|
VMINFO_DIR="/lmn/media/${USER}"
|
||||||
fi
|
fi
|
||||||
mkdir -p "${VM_MEDIADIR}" -m 700
|
|
||||||
chgrp "$(id -g)" "${VM_MEDIADIR}"
|
|
||||||
create_printerlist
|
create_printerlist
|
||||||
create_mountlist
|
create_mountlist
|
||||||
|
|
||||||
|
|
@ -369,7 +368,7 @@ if ! virsh --connect="${QEMU}" list | grep "${VM_NAME}-clone"; then
|
||||||
[[ "${QEMU}" = 'qemu:///session' ]] && start_virtiofsd
|
[[ "${QEMU}" = 'qemu:///session' ]] && start_virtiofsd
|
||||||
|
|
||||||
# Create VMInfo Json file
|
# Create VMInfo Json file
|
||||||
#( umask 077; ./vm-create-vminfo > "${VMINFO_DIR}/.vminfo.json" )
|
#( umask 027; ./vm-create-vminfo > "${VMINFO_DIR}/.vminfo.json" )
|
||||||
# Start vminfo.timer
|
# Start vminfo.timer
|
||||||
systemctl --user restart vminfo.timer
|
systemctl --user restart vminfo.timer
|
||||||
|
|
||||||
|
|
|
||||||
50
roles/lmn_vm/files/vm-virtiofsd
Executable file
50
roles/lmn_vm/files/vm-virtiofsd
Executable file
|
|
@ -0,0 +1,50 @@
|
||||||
|
#!/usr/bin/bash
|
||||||
|
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
# if less than one arguments supplied, display usage
|
||||||
|
if [[ $# -ne 1 ]]; then
|
||||||
|
echo "This script takes as input the name of the VM " >&2
|
||||||
|
echo "Usage: $0 vm_name" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
VM_NAME="$1"
|
||||||
|
|
||||||
|
## Make sure VMs can read the base directory:
|
||||||
|
chgrp 1010 "/lmn/media/${SUDO_USER}"
|
||||||
|
chmod 0775 "/lmn/media/${SUDO_USER}"
|
||||||
|
|
||||||
|
socket="/run/user/$(id -u $SUDO_USER)/virtiofs-${VM_NAME}.sock"
|
||||||
|
|
||||||
|
# FIXME: This does not work. In windows, there is no virtiofs device.
|
||||||
|
# In GNU/Linux it's only readable.
|
||||||
|
#
|
||||||
|
#if ! systemctl -q is-active virtiofs-${VM_NAME}.socket ; then
|
||||||
|
# systemd-run --unit=virtiofs-${VM_NAME} \
|
||||||
|
# --slice=system-virtiofs \
|
||||||
|
# --collect \
|
||||||
|
# --socket-property=ListenStream="$socket" \
|
||||||
|
# --socket-property=Accept=no \
|
||||||
|
# --socket-property=SocketMode=0700 \
|
||||||
|
# --socket-property=SocketUser=${SUDO_USER} \
|
||||||
|
# --property=Type=exec \
|
||||||
|
# --property=StandardInput=socket \
|
||||||
|
# /usr/local/bin/virtiofsd --log-level debug --sandbox none \
|
||||||
|
# --syslog --fd=0 --shared-dir "/lmn/media/${SUDO_USER}"
|
||||||
|
#else
|
||||||
|
# systemctl restart virtiofs-${VM_NAME}.socket
|
||||||
|
#fi
|
||||||
|
|
||||||
|
if [[ ! -S "$socket" ]] ; then
|
||||||
|
systemd-run --unit=virtiofs-${VM_NAME} \
|
||||||
|
--slice=system-virtiofs \
|
||||||
|
--collect \
|
||||||
|
--property=Type=exec \
|
||||||
|
--property=SuccessExitStatus=1 \
|
||||||
|
--property="ExecStopPost=rm $socket" \
|
||||||
|
/usr/local/bin/virtiofsd --socket-path "$socket" \
|
||||||
|
--shared-dir "/lmn/media/${SUDO_USER}"
|
||||||
|
fi
|
||||||
|
sleep 1
|
||||||
|
chown "${SUDO_USER}" "$socket"
|
||||||
|
|
@ -57,9 +57,7 @@ def get_krb5 ():
|
||||||
def get_mounts():
|
def get_mounts():
|
||||||
mounts = []
|
mounts = []
|
||||||
mounts.append({ 'Drive': 'H', 'RemotePath': '\\\\server.pn.steinbeis.schule' + nethome.replace('/srv/samba/schools','').replace('/','\\'), 'Name': 'Home_Server' })
|
mounts.append({ 'Drive': 'H', 'RemotePath': '\\\\server.pn.steinbeis.schule' + nethome.replace('/srv/samba/schools','').replace('/','\\'), 'Name': 'Home_Server' })
|
||||||
mounts.append({ 'Drive': 'T', 'RemotePath': '\\\\server.pn.steinbeis.schule\\default-school\\share', 'Name': 'Tausch' })
|
mounts.append({ 'Drive': 'T', 'RemotePath': '\\\\server.pn.steinbeis.schule\default-school\share', 'Name': 'Tausch' })
|
||||||
if "role-teacher" in vminfo['Groups']:
|
|
||||||
mounts.append({ 'Drive': 'S', 'RemotePath': '\\\\server.pn.steinbeis.schule\\default-school\\students', 'Name': 'SuS' })
|
|
||||||
return mounts
|
return mounts
|
||||||
|
|
||||||
def get_user_folders():
|
def get_user_folders():
|
||||||
|
|
|
||||||
|
|
@ -16,13 +16,11 @@
|
||||||
name:
|
name:
|
||||||
- aria2
|
- aria2
|
||||||
- mktorrent
|
- mktorrent
|
||||||
- guestfs-tools
|
|
||||||
- libvirt-daemon-system
|
- libvirt-daemon-system
|
||||||
- virt-manager
|
- virt-manager
|
||||||
- virt-viewer
|
- virt-viewer
|
||||||
- dialog # for vm-netboot menu
|
- dialog # for vm-netboot menu
|
||||||
- python3-impacket
|
- python3-impacket
|
||||||
- virtiofsd
|
|
||||||
|
|
||||||
# - name: allow all users to use VMs
|
# - name: allow all users to use VMs
|
||||||
# lineinfile:
|
# lineinfile:
|
||||||
|
|
@ -127,7 +125,9 @@
|
||||||
- vm-upload
|
- vm-upload
|
||||||
- vm-sync
|
- vm-sync
|
||||||
- vm-link-images
|
- vm-link-images
|
||||||
|
- vm-virtiofsd
|
||||||
- vm-vminfo
|
- vm-vminfo
|
||||||
|
- virtiofsd
|
||||||
- vm-aria2
|
- vm-aria2
|
||||||
- uploadseed
|
- uploadseed
|
||||||
- desktop-sync
|
- desktop-sync
|
||||||
|
|
@ -222,7 +222,7 @@
|
||||||
Description=Create .vminfo.json for VMs
|
Description=Create .vminfo.json for VMs
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
ExecStart=/usr/bin/bash -c 'umask 077; /usr/local/bin/vm-vminfo > "{% if localhome %}/home{% else %}/lmn/media{% endif %}/${USER}/.vminfo.json"'
|
ExecStart=/usr/bin/bash -c 'umask 027; /usr/local/bin/vm-vminfo > "{% if localhome %}/home{% else %}/lmn/media{% endif %}/${USER}/.vminfo.json"'
|
||||||
dest: /etc/systemd/user/vminfo.service
|
dest: /etc/systemd/user/vminfo.service
|
||||||
mode: '0644'
|
mode: '0644'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,5 +29,3 @@
|
||||||
- name: Configure Wireguard
|
- name: Configure Wireguard
|
||||||
ansible.builtin.include_tasks: wg_config.yml
|
ansible.builtin.include_tasks: wg_config.yml
|
||||||
when: vpn is defined and vpn == "wg"
|
when: vpn is defined and vpn == "wg"
|
||||||
tags:
|
|
||||||
- no_ansible_pull
|
|
||||||
|
|
|
||||||
|
|
@ -39,5 +39,3 @@
|
||||||
- name: Configure WPA-Enterprise (EAP-TLS)
|
- name: Configure WPA-Enterprise (EAP-TLS)
|
||||||
ansible.builtin.include_tasks: eap-tls_check-certificate.yaml
|
ansible.builtin.include_tasks: eap-tls_check-certificate.yaml
|
||||||
when: wlan == 'eap-tls'
|
when: wlan == 'eap-tls'
|
||||||
tags:
|
|
||||||
- no_ansible_pull
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue