Commit 1907f7a3 authored by nimrod's avatar nimrod
Browse files

Kodi role.

Not yet complete, but getting there.
parent 797bff70
Loading
Loading
Loading
Loading
Loading

kodi.yaml

0 → 100644
+7 −0
Original line number Diff line number Diff line
---
- hosts:
    - kodi
  roles:
    - kodi
  become: true
  become_user: root
+14 −0
Original line number Diff line number Diff line
[Unit]
Description=Kodi Media Center
Requires=dbus.socket
After=network.target
After=sound.target

[Service]
User=kodi
ExecStart=flatpak run --device=dri --filesystem=home --filesystem=/srv/library tv.kodi.Kodi --standalone --windowing=gbm
KillMode=control-group
Restart=always

[Install]
WantedBy=multi-user.target graphical.target
+53 −0
Original line number Diff line number Diff line
---
- name: APT install
  apt:
    name:
      - avahi-daemon
      - desktop-base
      - flatpak
      #- plymouth-themes
      - pulseaudio
      - udisks2
      - unison
      - upower

- name: Add Flatpak remotes
  with_dict:
    flathub: https://flathub.org/repo/flathub.flatpakrepo
    flathub-beta: https://flathub.org/beta-repo/flathub-beta.flatpakrepo
  community.general.flatpak_remote:
    flatpakrepo_url: '{{ item.value }}'
    method: system
    name: '{{ item.key }}'
    state: present

- name: Install Flatpak
  community.general.flatpak:
    method: system
    name: tv.kodi.Kodi
    remote: flathub-beta
    state: present

- name: Create user
  user:
    create_home: true
    home: /var/lib/kodi
    id: 999
    name: kodi
    password: '!'  # pragma: allowlist secret
    shell: /bin/false
    state: present
    system: true

- name: Copy service
  copy:
    dest: /etc/systemd/system/kodi.service
    mode: preserve
    src: kodi.service

- name: Enable service
  service:
    daemon-reload: true
    enabled: true
    name: kodi.service
    state: started