From b53a56ddf01c5c4bb1891d752bd8310fcc69a8c4 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sat, 23 Feb 2019 15:52:33 +0100 Subject: added role for elevate dolmetsch raspi --- roles/elevate/dolmetsch-raspi/defaults/main.yml | 3 ++ roles/elevate/dolmetsch-raspi/tasks/main.yml | 52 +++++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 roles/elevate/dolmetsch-raspi/defaults/main.yml create mode 100644 roles/elevate/dolmetsch-raspi/tasks/main.yml diff --git a/roles/elevate/dolmetsch-raspi/defaults/main.yml b/roles/elevate/dolmetsch-raspi/defaults/main.yml new file mode 100644 index 00000000..987a0481 --- /dev/null +++ b/roles/elevate/dolmetsch-raspi/defaults/main.yml @@ -0,0 +1,3 @@ +--- +dolmetsch_raspi_golang_version: 1.11.5 +dolmetsch_raspi_golang_checksum: "sha256:b26b53c94923f78955236386fee0725ef4e76b6cb47e0df0ed0c0c4724e7b198" diff --git a/roles/elevate/dolmetsch-raspi/tasks/main.yml b/roles/elevate/dolmetsch-raspi/tasks/main.yml new file mode 100644 index 00000000..9b3c442c --- /dev/null +++ b/roles/elevate/dolmetsch-raspi/tasks/main.yml @@ -0,0 +1,52 @@ +--- +- name: install packages + apt: + name: + - gstreamer1.0-plugins-base + - gstreamer1.0-plugins-good + - gstreamer1.0-plugins-bad + - gstreamer-tools + - git + - libasound2-dev + +- 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) + with_items: + - dolmetschctl + - dolmetschctld + command: "/usr/local/go/bin/go get spreadspace.org/dolmetschctl/cmd/{{ item }}" + args: + creates: "/opt/dolmetschctl/bin/{{ item }}" + environment: + GOPATH: /opt/dolmetschctl -- cgit v1.2.3