From 1f87e8f5d08c96de2f0e57452d4837be67595e80 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sun, 18 Sep 2022 21:16:08 +0200 Subject: add simple kodi config role --- roles/kodi/config/tasks/main.yml | 54 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 roles/kodi/config/tasks/main.yml (limited to 'roles/kodi/config/tasks/main.yml') diff --git a/roles/kodi/config/tasks/main.yml b/roles/kodi/config/tasks/main.yml new file mode 100644 index 00000000..e3c6ef25 --- /dev/null +++ b/roles/kodi/config/tasks/main.yml @@ -0,0 +1,54 @@ +--- + ## Kodi only supports NFSv3, however it will probably work with Kodi 20+ (https://github.com/xbmc/xbmc/pull/21659) +- name: mount NFSv4 volumes + loop: "{{ kodi_config_nfs4_mounts }}" + loop_control: + label: "{{ item.src }} -> {{ item.path }}" + mount: + src: "{{ item.src }}" + path: "{{ item.path }}" + fstype: nfs4 + opts: nodev,x-systemd.automount,nofail,ro + state: mounted + +- name: install python lxml + apt: + name: "{{ python_basename }}-lxml" + state: present + +- name: stop kodi + systemd: + name: kodi.service + state: stopped + +- name: configure guisettings.xml + loop: "{{ kodi_config_guisettings | dict2items }}" + loop_control: + label: "{{ item.key }} = {{ item.value }}" + xml: + path: /home/kodi/.kodi/userdata/guisettings.xml + xpath: '/settings/setting[@id="{{ item.key }}"]' + value: "{{ item.value }}" + pretty_print: yes + +- name: configure guisettings.xml + loop: "{{ kodi_config_guisettings | dict2items }}" + loop_control: + label: "{{ item.key }} = {{ item.value }}" + xml: + path: /home/kodi/.kodi/userdata/guisettings.xml + xpath: '/settings/setting[@id="{{ item.key }}"]/@default' + state: absent + pretty_print: yes + +- name: generate sources.xml + template: + src: sources.xml.j2 + dest: /home/kodi/.kodi/userdata/sources.xml + owner: kodi + group: kodi + +- name: start kodi + systemd: + name: kodi.service + state: started -- cgit v1.2.3