Compare commits
No commits in common. "fb98d53fad342add0c2a5527e13b1e9ac5fdd365" and "d34a2d78e87d2fb4e912c6f36c3c9c38f9746239" have entirely different histories.
fb98d53fad
...
d34a2d78e8
7 changed files with 36 additions and 53 deletions
|
|
@ -33,7 +33,6 @@
|
||||||
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 %}
|
||||||
|
|
|
||||||
33
roles/lmn_misc/files/reporter
Executable file
33
roles/lmn_misc/files/reporter
Executable file
|
|
@ -0,0 +1,33 @@
|
||||||
|
#!/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 is defined and grub_pwd is truthy
|
when: grub_pwd | bool | default(false)
|
||||||
|
|
||||||
- name: Allow booting grub menu entries
|
- name: Allow booting grub menu entries
|
||||||
ansible.builtin.lineinfile:
|
ansible.builtin.lineinfile:
|
||||||
|
|
@ -190,36 +190,6 @@
|
||||||
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
|
||||||
|
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
[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
|
|
||||||
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
[Unit]
|
|
||||||
Description=Run LMN Updater every day
|
|
||||||
After=network-online.target
|
|
||||||
|
|
||||||
[Timer]
|
|
||||||
OnBootSec=5min
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=timers.target
|
|
||||||
|
|
@ -16,7 +16,6 @@ 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 is defined and apt_conf is truthy
|
when: apt_conf | bool | default(false)
|
||||||
|
|
||||||
- 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 is defined and ntp_serv is truthy
|
when: ntp_serv | bool | default(false)
|
||||||
|
|
||||||
- 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