Touch display Ansible config
This commit is contained in:
parent
e57f803a52
commit
305e19b3b8
7 changed files with 131 additions and 0 deletions
18
touch_display/inventory.yml
Normal file
18
touch_display/inventory.yml
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
predavalnice_pi:
|
||||||
|
# Skupne spremenljivke za vse zaslone
|
||||||
|
vars:
|
||||||
|
# Check here: https://github.com/leukipp/touchkio/releases
|
||||||
|
touchkio_version: "1.1.2"
|
||||||
|
# Multimedia network
|
||||||
|
static_ip_netmask: "255.255.255.0"
|
||||||
|
static_ip_gateway: "192.168.190.1"
|
||||||
|
static_ip_dns_servers:
|
||||||
|
- "212.235.188.28"
|
||||||
|
- "212.235.188.29"
|
||||||
|
hosts:
|
||||||
|
p01_touch_display:
|
||||||
|
predavalnica: p01
|
||||||
|
static_ip_address: "192.168.190.111"
|
||||||
|
hostname: "p01_touch_display.local"
|
||||||
|
kiosk_url: "http://192.168.190.110"
|
||||||
|
|
6
touch_display/main.yml
Normal file
6
touch_display/main.yml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
- hosts: predavalnice_pi
|
||||||
|
# TODO: better include (import playbook)
|
||||||
|
tasks:
|
||||||
|
- include_tasks: static_ip.yml
|
||||||
|
- include_tasks: pi_stuff.yml
|
||||||
|
- include_tasks: touch_display.yml
|
36
touch_display/pi_stuff.yml
Normal file
36
touch_display/pi_stuff.yml
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
- name: Enable boot splash screen
|
||||||
|
become: true
|
||||||
|
shell: "raspi-config nonint get_boot_splash && raspi-config nonint do_boot_splash 0"
|
||||||
|
register: boot_splash
|
||||||
|
changed_when:
|
||||||
|
- boot_splash == "1"
|
||||||
|
|
||||||
|
- name: Disable color splash
|
||||||
|
become: true
|
||||||
|
community.general.ini_file:
|
||||||
|
path: /boot/firmware/config.txt
|
||||||
|
option: disable_splash
|
||||||
|
value: 1
|
||||||
|
no_extra_spaces: true
|
||||||
|
|
||||||
|
- name: Change splash image
|
||||||
|
become: true
|
||||||
|
copy:
|
||||||
|
src: splash.png
|
||||||
|
dest: /usr/share/plymouth/themes/pix/splash.png
|
||||||
|
|
||||||
|
- name: Remove desktop bloat
|
||||||
|
become: true
|
||||||
|
apt:
|
||||||
|
name:
|
||||||
|
- gvfs
|
||||||
|
- gnome-keyring
|
||||||
|
- cups
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: Switch to wayfire
|
||||||
|
become: true
|
||||||
|
shell: "raspi-config nonint is_wayfire && raspi-config nonint do_wayland W2"
|
||||||
|
register: result
|
||||||
|
failed_when: ( result.rc not in [ 0, 1 ] )
|
||||||
|
changed_when: ( result.rc == 1 )
|
BIN
touch_display/splash.png
Normal file
BIN
touch_display/splash.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 39 KiB |
28
touch_display/static_ip.yml
Normal file
28
touch_display/static_ip.yml
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
|
||||||
|
- name: Configure static IP address (using Network Manager).
|
||||||
|
become: yes
|
||||||
|
community.general.nmcli:
|
||||||
|
conn_name: "Multimedia net"
|
||||||
|
ifname: eth0
|
||||||
|
type: ethernet
|
||||||
|
ip4: "{{ static_ip_address }}/{{ static_ip_netmask | ansible.utils.ipaddr('prefix') }}"
|
||||||
|
gw4: "{{static_ip_gateway}}"
|
||||||
|
state: present
|
||||||
|
|
||||||
|
- name: Restart NetworkManager
|
||||||
|
become: yes
|
||||||
|
service:
|
||||||
|
name: NetworkManager
|
||||||
|
state: restarted
|
||||||
|
|
||||||
|
- name: Wait for network to be available
|
||||||
|
become: yes
|
||||||
|
wait_for_connection:
|
||||||
|
timeout: 60
|
||||||
|
|
||||||
|
# TODO: get rid of netaddr
|
||||||
|
- name: Display new IP configuration
|
||||||
|
debug:
|
||||||
|
msg: "Static IP configured: {{ static_ip_address }}/{{ static_ip_netmask | ansible.utils.ipaddr('prefix') }}"
|
||||||
|
|
||||||
|
|
32
touch_display/touch_display.yml
Normal file
32
touch_display/touch_display.yml
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
|
||||||
|
- name: Download .deb file
|
||||||
|
get_url:
|
||||||
|
url: "https://github.com/leukipp/touchkio/releases/download/v{{ touchkio_version }}/touchkio_{{ touchkio_version }}_arm64.deb"
|
||||||
|
dest: "/tmp/touchkio_{{ touchkio_version }}_arm64.deb"
|
||||||
|
register: deb_download
|
||||||
|
|
||||||
|
- name: Install the latest .deb package
|
||||||
|
become: yes
|
||||||
|
apt:
|
||||||
|
deb: "/tmp/touchkio_{{ touchkio_version }}_arm64.deb"
|
||||||
|
when: deb_download is succeeded
|
||||||
|
|
||||||
|
- name: Create systemd user service directory
|
||||||
|
file:
|
||||||
|
path: "{{ ansible_env.HOME }}/.config/systemd/user"
|
||||||
|
state: directory
|
||||||
|
|
||||||
|
- name: Create systemd user service
|
||||||
|
template:
|
||||||
|
src: touchkio.service.j2
|
||||||
|
dest: "{{ ansible_env.HOME }}/.config/systemd/user/touchkio.service"
|
||||||
|
|
||||||
|
- name: Enable systemd service
|
||||||
|
ansible.builtin.systemd_service:
|
||||||
|
name: touchkio
|
||||||
|
enabled: true
|
||||||
|
state: restarted
|
||||||
|
scope: user
|
||||||
|
daemon_reload: true
|
||||||
|
|
||||||
|
when: ansible_check_mode == false
|
11
touch_display/touchkio.service.j2
Normal file
11
touch_display/touchkio.service.j2
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
[Unit]
|
||||||
|
Description=TouchKio
|
||||||
|
After=graphical.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
ExecStart=/usr/bin/touchkio --web-url="{{ kiosk_url }}"
|
||||||
|
Restart=on-failure
|
||||||
|
RestartSec=5s
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=default.target
|
Loading…
Reference in a new issue