Compare commits
8 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fb98d53fad | ||
|
|
c90e626e3d | ||
|
|
cf5e11d7f1 | ||
|
|
3deccfb88f | ||
|
|
6558f376f5 | ||
|
|
51135966d3 | ||
|
|
8ee5517612 | ||
|
|
c4dbcffebd |
7 changed files with 53 additions and 36 deletions
|
|
@ -33,6 +33,7 @@
|
||||||
dest: /etc/profile.d/lmn-logout.sh
|
dest: /etc/profile.d/lmn-logout.sh
|
||||||
mode: '0755'
|
mode: '0755'
|
||||||
content: |
|
content: |
|
||||||
|
# logout script (may be empty)
|
||||||
{% if localhome_logout_missing_serverhome %}
|
{% if localhome_logout_missing_serverhome %}
|
||||||
[[ "${UID}" -gt 10000 ]] && ! findmnt /srv/samba/schools/default-school > /dev/null && exit 0
|
[[ "${UID}" -gt 10000 ]] && ! findmnt /srv/samba/schools/default-school > /dev/null && exit 0
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
||||||
|
|
@ -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
|
|
||||||
|
|
@ -98,7 +98,7 @@
|
||||||
export superusers
|
export superusers
|
||||||
password_pbkdf2 root {{ grub_pwd }}
|
password_pbkdf2 root {{ grub_pwd }}
|
||||||
notify: Run update-grub
|
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
|
- name: Allow booting grub menu entries
|
||||||
ansible.builtin.lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
|
|
@ -190,6 +190,36 @@
|
||||||
tags:
|
tags:
|
||||||
- baseinstall
|
- 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
|
# Prepare CloneScreen on Presenter PCs
|
||||||
|
|
||||||
- name: Fix primary screen for class room PCs with projector
|
- name: Fix primary screen for class room PCs with projector
|
||||||
|
|
|
||||||
9
roles/lmn_misc/templates/lmn-updater.service.j2
Normal file
9
roles/lmn_misc/templates/lmn-updater.service.j2
Normal 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 \
|
||||||
|
-i {{ misc_updater_inventory }} --url={{ misc_updater_repository }} -C {{ misc_updater_branch }} lmn-client.yml
|
||||||
|
|
||||||
9
roles/lmn_misc/templates/lmn-updater.timer.j2
Normal file
9
roles/lmn_misc/templates/lmn-updater.timer.j2
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Run LMN Updater every day
|
||||||
|
After=network-online.target
|
||||||
|
|
||||||
|
[Timer]
|
||||||
|
OnBootSec=5min
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=timers.target
|
||||||
|
|
@ -16,6 +16,7 @@ cmds=(
|
||||||
'ip link show | \
|
'ip link show | \
|
||||||
sed -nE -e "s/^[2-9]: (\S+): .+/\1/p" -e "s/.+ether ([0-9a-f:]+) .+/\1/p" | \
|
sed -nE -e "s/^[2-9]: (\S+): .+/\1/p" -e "s/.+ether ([0-9a-f:]+) .+/\1/p" | \
|
||||||
paste - -'
|
paste - -'
|
||||||
|
'systemctl --failed | grep -v "^$"'
|
||||||
)
|
)
|
||||||
# 'w'
|
# 'w'
|
||||||
# 'uptime'
|
# 'uptime'
|
||||||
|
|
|
||||||
|
|
@ -5,14 +5,14 @@
|
||||||
mode: '0644'
|
mode: '0644'
|
||||||
content: >
|
content: >
|
||||||
{{ apt_conf }}
|
{{ apt_conf }}
|
||||||
when: apt_conf | bool | default(false)
|
when: apt_conf is defined and apt_conf is truthy
|
||||||
|
|
||||||
- name: Set NTP server
|
- name: Set NTP server
|
||||||
ansible.builtin.lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
path: /etc/systemd/timesyncd.conf
|
path: /etc/systemd/timesyncd.conf
|
||||||
insertafter: '^#NTP='
|
insertafter: '^#NTP='
|
||||||
line: NTP={{ ntp_serv }}
|
line: NTP={{ ntp_serv }}
|
||||||
when: ntp_serv | bool | default(false)
|
when: ntp_serv is defined and ntp_serv is truthy
|
||||||
|
|
||||||
- name: Add proposed-updates repository
|
- name: Add proposed-updates repository
|
||||||
ansible.builtin.apt_repository:
|
ansible.builtin.apt_repository:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue