Skip to content
This repository has been archived by the owner on Apr 5, 2023. It is now read-only.

Adding Ubuntu 20 compatibility #77

Merged
merged 4 commits into from
Jan 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ galaxy_info:
- name: Debian
versions:
- buster
- name: Ubuntu
versions:
- bionic

galaxy_tags:
- raspberrypi
Expand Down
14 changes: 12 additions & 2 deletions tasks/install_usb_gadget.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
---
- name: set the path to config.txt on non-Ubuntu systems
set_fact:
config_txt_path: /boot/config.txt
when: ansible_distribution != 'Ubuntu'

- name: set the path to config.txt for Ubuntu
set_fact:
config_txt_path: /boot/firmware/config.txt
when: ansible_distribution == 'Ubuntu'

- name: check for a boot config file
stat:
path: /boot/config.txt
path: "{{ config_txt_path }}"
register: boot_config_stat

- name: enable dwc2 driver in boot config
lineinfile:
path: /boot/config.txt
path: "{{ config_txt_path }}"
create: no
line: dtoverlay=dwc2
when: boot_config_stat.stat.exists
Expand Down
25 changes: 18 additions & 7 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,28 @@
- name: install HID USB gadget
import_tasks: install_usb_gadget.yml

- name: install TinyPilot pre-requisite packages
apt:
name: "{{ packages }}"
state: present
vars:
packages:
- name: collect TinyPilot required apt packages on all systems
set_fact:
tinypilot_packages:
- git
- python-pip
- python3-venv
- sudo

- name: collect Debian and Ubuntu specific TinyPilot required apt packages
set_fact:
tinypilot_packages: "{{ tinypilot_packages }} + ['python-pip']"
when: ansible_distribution == 'Debian' or (ansible_distribution == 'Ubuntu' and ansible_distribution_version != '20.04')

- name: collect Ubuntu 20.04 specific TinyPilot required apt packages
set_fact:
tinypilot_packages: "{{ tinypilot_packages }} + ['python3-pip']"
when: ansible_distribution == 'Ubuntu' and ansible_distribution_version == '20.04'

- name: install TinyPilot pre-requisite packages
apt:
name: "{{ tinypilot_packages }}"
state: present

- name: create tinypilot group
group:
name: "{{ tinypilot_group }}"
Expand Down