From 7eea8662da2171e18807049362110a69a25a2160 Mon Sep 17 00:00:00 2001 From: polyfloyd Date: Sun, 10 Sep 2023 19:31:49 +0200 Subject: [PATCH] services: Remove flipdot --- roles/services/defaults/main.yaml | 2 -- roles/services/handlers/main.yaml | 6 ----- roles/services/tasks/flipdot.yaml | 28 ---------------------- roles/services/tasks/main.yaml | 3 --- roles/services/templates/flipdot-reboot.sh | 4 ---- roles/services/templates/flipdot-time.sh | 25 ------------------- roles/services/templates/flipdot.service | 16 ------------- 7 files changed, 84 deletions(-) delete mode 100644 roles/services/defaults/main.yaml delete mode 100644 roles/services/tasks/flipdot.yaml delete mode 100644 roles/services/templates/flipdot-reboot.sh delete mode 100644 roles/services/templates/flipdot-time.sh delete mode 100644 roles/services/templates/flipdot.service diff --git a/roles/services/defaults/main.yaml b/roles/services/defaults/main.yaml deleted file mode 100644 index 6143a15..0000000 --- a/roles/services/defaults/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ -flipdot_host: 100.64.0.90 -flipdot_powebar_num: 3 diff --git a/roles/services/handlers/main.yaml b/roles/services/handlers/main.yaml index 67870bf..30f7392 100644 --- a/roles/services/handlers/main.yaml +++ b/roles/services/handlers/main.yaml @@ -1,12 +1,6 @@ --- - import_tasks: ../../common/handlers/main.yaml -- name: restart flipdot - systemd: - name: flipdot - state: restarted - daemon_reload: true - - name: restart irc-bot systemd: name: irc-bot diff --git a/roles/services/tasks/flipdot.yaml b/roles/services/tasks/flipdot.yaml deleted file mode 100644 index 48d3674..0000000 --- a/roles/services/tasks/flipdot.yaml +++ /dev/null @@ -1,28 +0,0 @@ ---- -- name: Install flipdot scripts - template: - src: "{{ item }}" - dest: "/usr/local/bin/{{ item }}" - owner: root - group: root - mode: 0755 - notify: restart flipdot - with_items: - - flipdot-reboot.sh - - flipdot-time.sh - -- name: Install flipdot service - template: - src: flipdot.service - dest: /etc/systemd/system/flipdot.service - owner: root - group: root - mode: 0644 - notify: restart flipdot - -- name: Start flipdot - systemd: - name: flipdot - state: started - enabled: yes - daemon_reload: true diff --git a/roles/services/tasks/main.yaml b/roles/services/tasks/main.yaml index 145878f..d6d4d17 100644 --- a/roles/services/tasks/main.yaml +++ b/roles/services/tasks/main.yaml @@ -5,9 +5,6 @@ - tags: services_discord_bot import_tasks: discord_bot.yaml -- tags: services_flipdot - import_tasks: flipdot.yaml - - tags: services_siahsd import_tasks: siahsd.yaml diff --git a/roles/services/templates/flipdot-reboot.sh b/roles/services/templates/flipdot-reboot.sh deleted file mode 100644 index 8897c08..0000000 --- a/roles/services/templates/flipdot-reboot.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -powerbar-switch {{ flipdot_powebar_num }} off -powerbar-switch {{ flipdot_powebar_num }} on diff --git a/roles/services/templates/flipdot-time.sh b/roles/services/templates/flipdot-time.sh deleted file mode 100644 index 30943c8..0000000 --- a/roles/services/templates/flipdot-time.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -# Managed by Ansible - -set -eu - -HOST={{ flipdot_host }} - -while true; do - time=`date +%H:%M` - tmp=/tmp/flipdot.gray - - convert -size 336x16 xc:black -density 800x240 -font Liberation-Mono -pointsize 6 -fill white -gravity Center -annotate +0+1 `date +%H:%M` -draw "line 0,15,$(((`date +1%S`-100)*56/10)),15" -depth 8 $tmp - (echo -ne "\x00\x00\x15\x00" ; dd if=$tmp bs=5376 count=1 2>/dev/null) | nc -q1 -w1 $HOST 7890 - sleep 1 - convert -size 336x16 xc:black -density 800x240 -font Liberation-Mono -pointsize 6 -fill white -gravity Center -annotate +0+1 "`date "+%H %M"`" -draw "line 0,15,$(((`date +1%S`-100)*56/10)),15" -depth 8 $tmp - (echo -ne "\x00\x00\x15\x00" ; dd if=$tmp bs=5376 count=1 2>/dev/null) | nc -q1 -w1 $HOST 7890 - sleep 1 - - if [ $time != `date +%H:%M` ] - then - convert -size 336x16 xc:white -density 800x240 -font Liberation-Mono -pointsize 6 -fill black -gravity Center -annotate +0+1 `date +%H:%M` -depth 8 $tmp; (echo -ne "\x00\x00\x15\x00" ; dd if=$tmp bs=5376 count=1 2>/dev/null) | nc -q1 -w1 $HOST 7890 - sleep 2 - fi -done diff --git a/roles/services/templates/flipdot.service b/roles/services/templates/flipdot.service deleted file mode 100644 index 0146c0d..0000000 --- a/roles/services/templates/flipdot.service +++ /dev/null @@ -1,16 +0,0 @@ -# Managed by Ansible - -[Unit] -Description=Big flipdot display -After=network.target - -[Service] -Type=simple -ExecStart=/usr/local/bin/flipdot-time.sh -ExecStopPost=/usr/local/bin/flipdot-reboot.sh -Restart=on-failure -RestartSec=30s -DynamicUser=true - -[Install] -WantedBy=multi-user.target