debian.ansible.kodi/kodi.yml

133 lines
3.2 KiB
YAML
Raw Normal View History

2022-10-17 14:51:39 +02:00
---
2022-11-17 13:23:37 +01:00
- name: Kodi Setup
2022-10-17 14:51:39 +02:00
hosts: all
tasks:
2022-11-10 12:23:53 +01:00
- name: 1 GB swap (100MB default)
ansible.builtin.lineinfile:
path: /etc/dphys-swapfile
regexp: '^CONF_SWAPSIZE=.+$'
line: 'CONF_SWAPSIZE=1024'
backup: yes
2022-10-17 14:51:39 +02:00
- name: Install Basic Packages
apt:
name:
# share desk
- x11vnc
# useful other stuff
- pwgen
- arj
- p7zip
- unace
- unadf
- bvi
- fdupes
- radeontop
- debootstrap
- geoip-bin
- sshfs
- speedtest-cli
# tools for android-smartphones/LineageOS
- heimdall-flash
- android-tools-adb
- android-tools-fastboot
- android-tools-mkbootimg
2022-10-17 15:39:33 +02:00
# kodi and desktop specific
2022-10-25 15:39:20 +02:00
- cinnamon
2022-10-25 17:31:43 +02:00
- gnome-terminal
2022-10-17 15:39:33 +02:00
- lightdm
2022-10-17 17:09:21 +02:00
- kodi
2022-10-17 17:19:47 +02:00
- xserver-xorg
- xinit
- x11-xserver-utils
- dbus-x11
2022-10-19 12:48:28 +02:00
- dconf-cli
2022-10-17 14:51:39 +02:00
update_cache: yes
install_recommends: no
2022-10-21 15:14:25 +02:00
- name: Install Flatpaks x86_64
2022-10-17 14:51:39 +02:00
community.general.flatpak:
name:
2022-10-17 15:39:33 +02:00
- io.gitlab.librewolf-community
2022-10-21 15:14:25 +02:00
- tv.kodi.Kodi
2022-10-17 14:51:39 +02:00
state: present
method: system
2022-10-21 15:14:25 +02:00
when: ansible_architecture == "x86_64"
- name: Install Flatpaks arm64
community.general.flatpak:
name:
- io.gitlab.librewolf-community
state: present
method: system
when: ansible_architecture == "arm64"
2022-10-17 15:39:33 +02:00
2022-10-17 17:38:17 +02:00
- name: Create pi User
ansible.builtin.user:
name: pi
comment: pi
uid: 1100
group: users
2022-10-19 11:31:27 +02:00
groups: sudo,adm,audio,video,games,input,render,netdev
2022-10-17 17:38:17 +02:00
- name: Raspi /boot/config.txt
2022-10-25 16:23:35 +02:00
blockinfile:
path: /boot/config.txt
insertafter: EOF
marker: "# {mark} ANSIBLE MANAGED BLOCK"
block: |
gpu_mem=128
2022-10-25 16:23:35 +02:00
hdmi_force_hotplug=1
hdmi_mode=4
dtparam=audio=on
hdmi_drive=2
hdmi_ignore_edid=0xa5000080
config_hdmi_boost=4
hdmi_group=1
disable_overscan=1
2022-10-17 15:39:33 +02:00
- name: lightdm.conf
blockinfile:
path: /etc/lightdm/lightdm.conf
create: yes
mode: "0444"
owner: root
group: root
insertafter: "#exit-on-failure=false"
2022-10-25 16:23:35 +02:00
marker: "# {mark} ANSIBLE MANAGED BLOCK"
2022-10-17 15:39:33 +02:00
block: |
session-wrapper=/etc/X11/Xsession
2022-10-25 15:39:20 +02:00
user-session=cinnamon
2022-10-17 15:39:33 +02:00
greeter-hide-users=false
greeter-show-manual-login=true
allow-guest=false
xserver-command=X -core -dpi 96
2022-10-19 11:27:31 +02:00
autologin-user=pi
2022-10-17 15:39:33 +02:00
backup: yes
notify:
- Restart lightdm
2022-10-19 11:42:35 +02:00
- name: 'add lightdm to startup'
command: systemctl enable lightdm
2022-10-19 11:42:35 +02:00
args:
creates: /etc/systemd/system/display-manager.service
2022-10-19 11:42:35 +02:00
- name: "Get current systemd default"
command: "systemctl get-default"
changed_when: false
register: systemdefault
- name: "Set default to graphical target"
command: "systemctl set-default graphical.target"
when: "'graphical' not in systemdefault.stdout"
2022-10-17 15:39:33 +02:00
handlers:
- name: Restart lightdm
service:
name: lightdm
state: restarted