From 4fb8721a5bee04f0ccee0b5bf0f15d541c60368f Mon Sep 17 00:00:00 2001 From: kevinjin0420 Date: Wed, 26 Aug 2026 16:54:13 -0400 Subject: [PATCH] no snap on ubuntu --- ansible/roles/dev/tasks/apt.yml | 32 +++++++++++++++++++ ansible/roles/dev/tasks/main.yml | 3 ++ teleoperation/basestation_gui/gui_chromium.sh | 11 +++++-- 3 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 ansible/roles/dev/tasks/apt.yml diff --git a/ansible/roles/dev/tasks/apt.yml b/ansible/roles/dev/tasks/apt.yml new file mode 100644 index 000000000..f4cf826fa --- /dev/null +++ b/ansible/roles/dev/tasks/apt.yml @@ -0,0 +1,32 @@ +- name: Block snapd via apt preferences + become: true + ansible.builtin.copy: + dest: /etc/apt/preferences.d/nosnap.pref + content: | + Package: snapd + Pin: release a=* + Pin-Priority: -10 + +- name: Add Google Chrome apt repo + become: true + ansible.builtin.deb822_repository: + name: google-chrome + types: deb + uris: https://dl.google.com/linux/chrome/deb/ + suites: stable + components: main + architectures: amd64 + signed_by: https://dl.google.com/linux/linux_signing_key.pub + register: chrome_repo + +- name: Update APT Cache if Repo Changed + become: true + ansible.builtin.apt: + update_cache: true + when: chrome_repo.changed + +- name: Install Google Chrome + become: true + ansible.builtin.apt: + name: google-chrome-stable + state: present diff --git a/ansible/roles/dev/tasks/main.yml b/ansible/roles/dev/tasks/main.yml index 6a885ca4e..7797bb6dd 100644 --- a/ansible/roles/dev/tasks/main.yml +++ b/ansible/roles/dev/tasks/main.yml @@ -1,3 +1,6 @@ +- name: Install platform-specific packages + ansible.builtin.include_tasks: apt.yml + - name: Oh-My-Zsh git: repo: https://github.com/ohmyzsh/ohmyzsh.git diff --git a/teleoperation/basestation_gui/gui_chromium.sh b/teleoperation/basestation_gui/gui_chromium.sh index 12275b04d..f7f157560 100755 --- a/teleoperation/basestation_gui/gui_chromium.sh +++ b/teleoperation/basestation_gui/gui_chromium.sh @@ -7,5 +7,12 @@ while ! curl -s http://localhost:8000 >/dev/null 2>&1; do sleep 0.5 done -echo "Server is up, launching Chromium..." -exec chromium --app=${ADDRESS} +echo "Server up, launching browser..." +if command -v chromium &>/dev/null; then + exec chromium --app=${ADDRESS} +elif command -v google-chrome &>/dev/null; then # for debian/ubuntu + exec google-chrome --app=${ADDRESS} +else + echo "Error: neither chromium nor google-chrome found" >&2 + exit 1 +fi