From 02f37b869c8c585517a9c7b6cd95cfb7661f1490 Mon Sep 17 00:00:00 2001 From: Jason Wallace Date: Wed, 24 May 2023 16:34:46 +0200 Subject: [PATCH] Optionally install uStreamer from Debian package (#110) Related https://github.com/tiny-pilot/ansible-role-ustreamer/issues/100 This PR only builds uStreamer from source if a uStreamer Debian package is not provided. This will allow TinyPilot to specify a uStreamer Debian package and avoid building uStreamer from source on every install/update. I've [tested these changes in CI](https://app.circleci.com/pipelines/github/tiny-pilot/ansible-role-ustreamer/371/workflows/f85d89d6-bf24-40e7-868b-692299e6c38e/jobs/962?invite=true#step-104-396) via https://github.com/tiny-pilot/ansible-role-ustreamer/pull/110/commits/179fe044319d505e7bf48c0ac713741f06b3bae4. I've also tested these changes on device via a [scratch TinyPilot Pro PR](https://github.com/tiny-pilot/tinypilot-pro/pull/908). Review
on CodeApprove --- defaults/main.yml | 4 ++++ tasks/main.yml | 11 ++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index b1ab8be..053d31e 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,4 +1,8 @@ --- +# Specifies the filesystem path or URL of a Debian package that installs +# uStreamer. +ustreamer_debian_package_path: null + ustreamer_repo: https://github.com/pikvm/ustreamer.git ustreamer_repo_version: master diff --git a/tasks/main.yml b/tasks/main.yml index 1f95c5c..087151e 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -113,6 +113,11 @@ name: "{{ ustreamer_packages }}" state: present +- name: install uStreamer Debian package + apt: + deb: "{{ ustreamer_debian_package_path }}" + when: ustreamer_debian_package_path != None + - name: create uStreamer folder file: path: "{{ ustreamer_dir }}" @@ -125,6 +130,7 @@ # to set the correct directory ownership that allows git to sync. # Issue: https://github.com/tiny-pilot/tinypilot/issues/963 - molecule-idempotence-notest + when: ustreamer_debian_package_path == None - name: get uStreamer repo # Don't escalate privileges because only the directory owner can use git. @@ -139,6 +145,7 @@ # idempotency test on the previous task that allows git to sync. # Issue: https://github.com/tiny-pilot/tinypilot/issues/963 - molecule-idempotence-notest + when: ustreamer_debian_package_path == None # We always need to clean and build uStreamer to ensure that the uStreamer # service is in sync with its dependencies installed on the device. @@ -149,6 +156,7 @@ target: clean tags: - molecule-idempotence-notest + when: ustreamer_debian_package_path == None - name: build uStreamer make: @@ -159,6 +167,7 @@ - restart uStreamer tags: - molecule-idempotence-notest + when: ustreamer_debian_package_path == None - name: fix uStreamer folder permissions file: @@ -212,7 +221,7 @@ dest: "{{ ustreamer_janus_plugins_dir }}" notify: - restart Janus - when: ustreamer_install_janus + when: ustreamer_debian_package_path == None and ustreamer_install_janus - name: install uStreamer launcher import_tasks: install_launcher.yml