Aktualisisert von Coderberg

This commit is contained in:
Frank Schiebel 2026-08-05 13:05:20 +02:00
parent 8caa3cf881
commit 0ccf139311
41 changed files with 649 additions and 186 deletions

View file

@ -5,11 +5,11 @@
set -eu
cur="$(efibootmgr | grep -Ei 'BootOrder:' | \
sed -E 's/^BootOrder: ([[:xdigit:]]{4}),.+$/\1/')"
pxeip4="$(efibootmgr | grep -Ei "IP.*4" | \
sed -E 's/^Boot([[:xdigit:]]{4}).+$/\1/')"
sed -E 's/^BootOrder: ([[:xdigit:]]{4}),.+$/\1/')"
pxeip4="$(efibootmgr | grep -Ei "IP.{0,5}4" | \
sed -E 's/^Boot([[:xdigit:]]{4}).+$/\1/' | paste -sd, -)"
debian="$(efibootmgr | grep -Ei "debian" | \
sed -E 's/^Boot([[:xdigit:]]{4}).+$/\1/')"
sed -E 's/^Boot([[:xdigit:]]{4}).+$/\1/' | paste -sd, -)"
if [[ "$cur" != "$pxeip4" ]] && [[ -n "$pxeip4" ]] && [[ -n "$debian" ]] ; then
efibootmgr -o $pxeip4,$debian

View file

@ -1,33 +0,0 @@
#!/usr/bin/bash
#
# Send stdout of some commands to monitoring server.
# Collect the reports with 'nc -u -k -l 1234' on 'sendto'.
# Use /bin/nc.openbsd, /bin/nc.traditional seems not to work.
#
set -eu
sendto="collector.steinbeis.schule 1234"
n=0
cmds=(
'uname -a'
'tail -1 /var/local/ansible-stamps'
'ip route list default'
'ip link show | \
sed -nE -e "s/^[2-9]: (\S+): .+/\1/p" -e "s/.+ether ([0-9a-f:]+) .+/\1/p" | \
paste - -'
)
# 'w'
# 'uptime'
# 'ls -d --full-time /home/ansible/.ansible/tmp/'
# 'ip addr show'
# 'apt list --upgradeable -o Apt::Cmd::Disable-Script-Warning=true'
r="$HOSTNAME ------- $(date --rfc-3339=seconds) -------
$(for c in "${cmds[@]}" ; do
n=$(( n + 1 ))
echo -n "$n"
eval "$c" | sed 's/^/\t/'
done | sed "s/^/$HOSTNAME /")
## -------------------------------------------------"
echo "$r" | nc -w 1 -u $sendto

View file

@ -98,7 +98,7 @@
export superusers
password_pbkdf2 root {{ grub_pwd }}
notify: Run update-grub
when: grub_pwd | bool | default(false)
when: grub_pwd is defined and grub_pwd is truthy
- name: Allow booting grub menu entries
ansible.builtin.lineinfile:
@ -167,6 +167,8 @@
src: reporter.j2
dest: /usr/local/sbin/reporter
mode: '0755'
tags:
- baseinstall
- name: Provide services and timers for reporter
ansible.builtin.copy:
@ -177,12 +179,46 @@
- reporter.service
- reporter.timer
when: misc_reporter
tags:
- baseinstall
- name: Enable reporter.timer
ansible.builtin.systemd:
name: reporter.timer
enabled: true
when: misc_reporter
tags:
- baseinstall
# Updater
- name: Provide services and timers for updater
ansible.builtin.template:
src: "{{ item }}.j2"
dest: "/etc/systemd/system/{{ item }}"
mode: '0644'
loop:
- lmn-updater.service
- lmn-updater.timer
when: misc_updater_repository | default(false) is truthy
- name: Enable updater.timer
ansible.builtin.systemd:
name: lmn-updater.timer
enabled: true
when:
- misc_updater_repository | default(false) is truthy
- misc_updater_autostart | default(false) is truthy
- name: Deploy inventory password file
ansible.builtin.copy:
dest: /root/.inventory-pw
owner: root
mode: '0640'
content: "{{ misc_updater_inventory_password }}"
when:
- misc_updater_repository | default(false) is truthy
- misc_updater_inventory_password | default(false) is truthy
# Prepare CloneScreen on Presenter PCs

View file

@ -22,8 +22,8 @@ fi
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] }}
{% else %}
if pactl list cards | grep output:hdmi-stereo: | grep verfügbar:\ ja; then
if pactl list cards | grep output:hdmi-stereo: | grep -E "verfügbar: ja|available: yes"; then
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).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
fi
{% endif %}

View file

@ -0,0 +1,9 @@
[Unit]
Description=Run LMN Client updates via ansible-pull
[Service]
Type=oneshot
User=root
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

View file

@ -0,0 +1,9 @@
[Unit]
Description=Run LMN Updater every day
After=network-online.target
[Timer]
OnBootSec=5min
[Install]
WantedBy=timers.target

View file

@ -16,6 +16,7 @@ cmds=(
'ip link show | \
sed -nE -e "s/^[2-9]: (\S+): .+/\1/p" -e "s/.+ether ([0-9a-f:]+) .+/\1/p" | \
paste - -'
'systemctl --failed | grep -v "^$"'
)
# 'w'
# 'uptime'