aboutsummaryrefslogtreecommitdiffstats
path: root/roles/jumbotron
diff options
context:
space:
mode:
authorMax Campbell <maxc@maxc.in>2019-02-10 01:52:18 +0100
committerEmil Renner Berthing <esmil@labitat.dk>2019-03-20 18:47:12 +0100
commitb79071389517ed6d2360459283b9f41c503603a6 (patch)
treeda4272821b7fa6fd4c588cad46c993341490a27b /roles/jumbotron
parent9d57f4c53ba97f3efe2afbb89b405e5579cc3b3e (diff)
downloadlabitat-ansible-b79071389517ed6d2360459283b9f41c503603a6.tar.gz
labitat-ansible-b79071389517ed6d2360459283b9f41c503603a6.tar.xz
labitat-ansible-b79071389517ed6d2360459283b9f41c503603a6.zip
jumbotron: fakta: added fakta bell
Diffstat (limited to 'roles/jumbotron')
-rw-r--r--roles/jumbotron/files/fakta-bell.sh31
-rw-r--r--roles/jumbotron/files/fakta.service7
-rw-r--r--roles/jumbotron/files/fakta.timer9
-rw-r--r--roles/jumbotron/tasks/fakta.yml37
-rw-r--r--roles/jumbotron/tasks/main.yml2
5 files changed, 86 insertions, 0 deletions
diff --git a/roles/jumbotron/files/fakta-bell.sh b/roles/jumbotron/files/fakta-bell.sh
new file mode 100644
index 0000000..1adf451
--- /dev/null
+++ b/roles/jumbotron/files/fakta-bell.sh
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+for i in 1 2 3; do
+ gpio write 2 1
+ sleep 0.01
+ gpio write 2 0
+ sleep 0.1
+ gpio write 2 1
+ sleep 0.01
+ gpio write 2 0
+ sleep 0.01
+ gpio write 2 1
+ sleep 0.01
+ gpio write 2 1
+ sleep 0.01
+ gpio write 2 0
+ sleep 0.01
+ gpio write 2 1
+ sleep 0.01
+ gpio write 2 0
+ sleep 0.1
+ gpio write 2 1
+ sleep 0.01
+ gpio write 2 0
+ sleep 0.01
+ gpio write 2 1
+ sleep 0.01
+ gpio write 2 1
+ sleep 0.01
+ gpio write 2 0
+done
diff --git a/roles/jumbotron/files/fakta.service b/roles/jumbotron/files/fakta.service
new file mode 100644
index 0000000..7338d64
--- /dev/null
+++ b/roles/jumbotron/files/fakta.service
@@ -0,0 +1,7 @@
+[Unit]
+Description=Ring fakta bell
+
+[Service]
+Type=oneshot
+User=jumbotron
+ExecStart=/home/jumbotron/fakta-bell.sh
diff --git a/roles/jumbotron/files/fakta.timer b/roles/jumbotron/files/fakta.timer
new file mode 100644
index 0000000..1417a59
--- /dev/null
+++ b/roles/jumbotron/files/fakta.timer
@@ -0,0 +1,9 @@
+[Unit]
+Description=Ring fakta bell
+
+[Timer]
+OnCalendar=*-*-* 20:45:00
+Persistent=false
+
+[Install]
+WantedBy=timers.target
diff --git a/roles/jumbotron/tasks/fakta.yml b/roles/jumbotron/tasks/fakta.yml
new file mode 100644
index 0000000..0254e93
--- /dev/null
+++ b/roles/jumbotron/tasks/fakta.yml
@@ -0,0 +1,37 @@
+---
+- name: Copy fakta bell script
+ copy:
+ dest: '~jumbotron/fakta-bell.sh'
+ src: 'fakta-bell.sh'
+ owner: jumbotron
+ group: users
+ mode: 0755
+
+- name: Install our fakta service
+ copy:
+ dest: '/etc/systemd/system/fakta.service'
+ src: fakta.service
+ owner: root
+ group: root
+ mode: 0644
+ register: fakta_service
+
+- name: Install our fakta timer
+ copy:
+ dest: '/etc/systemd/system/fakta.timer'
+ src: fakta.timer
+ owner: root
+ group: root
+ mode: 0644
+ register: fakta_timer
+
+- name: Reload systemd
+ command: systemctl daemon-reload
+ when: fakta_service is changed or fakta_timer is changed
+
+- name: Enable fakta timer
+ systemd:
+ name: fakta.timer
+ enabled: yes
+ masked: no
+ state: started
diff --git a/roles/jumbotron/tasks/main.yml b/roles/jumbotron/tasks/main.yml
index e7c45a8..5e92162 100644
--- a/roles/jumbotron/tasks/main.yml
+++ b/roles/jumbotron/tasks/main.yml
@@ -38,5 +38,7 @@
tags: autologin
- import_tasks: irssi.yml
tags: irssi
+- import_tasks: fakta.yml
+ tags: fakta
# vim: set ts=2 sw=2 et: