summaryrefslogtreecommitdiff
path: root/roles/streaming/dolmetsch-raspi/tasks/main.yml
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2021-07-30 21:54:12 +0200
committerChristian Pointner <equinox@spreadspace.org>2021-07-30 21:54:12 +0200
commite578f4538dad9aa7cd977094e58293e847990d30 (patch)
treee69f9edd2fe8d312e0ee4d0f7fb3adda35d88d7e /roles/streaming/dolmetsch-raspi/tasks/main.yml
parentmove some legacy stuff to graveyard (diff)
move dolmetsch-raspi to generic folder
Diffstat (limited to 'roles/streaming/dolmetsch-raspi/tasks/main.yml')
-rw-r--r--roles/streaming/dolmetsch-raspi/tasks/main.yml81
1 files changed, 81 insertions, 0 deletions
diff --git a/roles/streaming/dolmetsch-raspi/tasks/main.yml b/roles/streaming/dolmetsch-raspi/tasks/main.yml
new file mode 100644
index 00000000..10d55766
--- /dev/null
+++ b/roles/streaming/dolmetsch-raspi/tasks/main.yml
@@ -0,0 +1,81 @@
+---
+- name: install packages
+ apt:
+ name:
+ - gstreamer1.0-tools
+ - gstreamer1.0-plugins-base
+ - gstreamer1.0-plugins-good
+ - gstreamer1.0-plugins-bad
+ - gstreamer1.0-alsa
+ - git
+ - libasound2-dev
+ - telnet
+
+- name: download golang tarball
+ get_url:
+ url: "https://dl.google.com/go/go{{ dolmetsch_raspi_golang_version }}.linux-armv6l.tar.gz"
+ dest: "/usr/local/src/go{{ dolmetsch_raspi_golang_version }}.linux-armv6l.tar.gz"
+ checksum: "{{ dolmetsch_raspi_golang_checksum }}"
+
+- name: check current goloang version (if any)
+ command: /usr/local/go/bin/go version
+ ignore_errors: yes
+ check_mode: no
+ changed_when: false
+ register: golang_version
+
+- name: update golang installation
+ when: golang_version is failed or golang_version.stdout != ("go version go" + dolmetsch_raspi_golang_version + " linux/arm")
+ block:
+ - name: remove old golang installation
+ file:
+ path: /usr/local/go
+ state: absent
+
+ - name: extract the golang tarball
+ unarchive:
+ src: "/usr/local/src/go{{ dolmetsch_raspi_golang_version }}.linux-armv6l.tar.gz"
+ dest: /usr/local
+ copy: no
+
+- name: prepare dolmetschctl install path
+ file:
+ path: /opt/dolmetschctl
+ state: directory
+
+- name: build dolmetschctl (server and client)
+ loop:
+ - dolmetschctl
+ - dolmetschctld
+ command: "/usr/local/go/bin/go get spreadspace.org/dolmetschctl/cmd/{{ item }}"
+ args:
+ creates: "/opt/dolmetschctl/bin/{{ item }}"
+ environment:
+ GOPATH: /opt/dolmetschctl
+
+- name: install dolmetschctl systemd units
+ loop:
+ - dolmetschctl
+ - dolmetschctld
+ template:
+ src: "{{ item }}.service.j2"
+ dest: "/etc/systemd/system/{{ item }}.service"
+ notify: reload systemd
+
+- name: install rtp send/receive scripts
+ loop:
+ - rtp-recv
+ - rtp-send
+ template:
+ src: "{{ item }}.sh.j2"
+ dest: "/usr/local/bin/{{ item }}.sh"
+ mode: 0750
+
+- name: install rtp send/receive systemd units
+ loop:
+ - rtp-recv
+ - rtp-send
+ template:
+ src: "{{ item }}.service.j2"
+ dest: "/etc/systemd/system/{{ item }}.service"
+ notify: reload systemd