diff --git a/ansible/roles/dev/tasks/apt.yml b/ansible/roles/dev/tasks/apt.yml new file mode 100644 index 00000000..f4cf826f --- /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 72483afb..049da8b3 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 12275b04..f7f15756 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