44 lines
1.3 KiB
YAML

#!/usr/bin/env ansible-playbook
# vim:ft=ansible:
---
- name: install kodi flatpak
community.general.flatpak:
name: "{{ kodi_flatpak_name }}"
state: present
- name: configure kodi autologon
block:
# Set up packages
- name: ensure ubuntu packages
when: ansible_pkg_mgr == "apt"
ansible.builtin.apt:
state: present
pkg: "{{ kodi_apt_packages }}"
notify: restart kodi
# Now do the whole user configuration thing
- name: ensure kodi dedicated user
ansible.builtin.user:
name: "{{ kodi_autologin_user }}"
password_lock: yes
shell: /bin/bash
groups: "{{ kodi_autologin_user_groups }}"
append: yes
notify: restart kodi
- name: get UID for kodi dedicated user
ansible.builtin.getent:
database: passwd
key: "{{ kodi_autologin_user }}"
- name: template out systemd unit file
ansible.builtin.template:
src: kodi.service
dest: "/etc/systemd/system/{{ kodi_autologin_service }}"
mode: 0644
owner: root
group: root
notify: restart kodi
- name: enable systemd unit
ansible.builtin.systemd:
name: "{{ kodi_autologin_service }}"
state: started
enabled: yes
daemon_reload: yes