debian.ansible.kodi/kodi.yml

151 lines
3.6 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:
- name: Install Basic Packages
apt:
name:
# share desk
- x11vnc
# useful other stuff
- pwgen
- fdupes
- sshfs
- speedtest-cli
# tools for android-smartphones/LineageOS
- heimdall-flash
2022-12-15 12:22:31 +01:00
- adb
- fastboot
2024-04-02 14:53:35 +02:00
- mkbootimg
2024-04-04 14:22:27 +02:00
# desktop specific
2022-10-25 15:39:20 +02:00
- cinnamon
2022-11-17 13:45:52 +01:00
- cinnamon-l10n
2022-10-25 17:31:43 +02:00
- gnome-terminal
2022-10-17 15:39:33 +02:00
- lightdm
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-12-23 15:59:58 +01:00
- dphys-swapfile
2024-04-03 14:28:42 +02:00
- lightdm-autologin-greeter
2024-04-03 16:48:13 +02:00
- tsdecrypt
2024-04-03 16:58:42 +02:00
- x264
- x265
2022-10-17 14:51:39 +02:00
update_cache: yes
install_recommends: no
2022-12-23 16:10:34 +01:00
- name: 1 GB swap (100MB default)
ansible.builtin.lineinfile:
path: /etc/dphys-swapfile
regexp: '^CONF_SWAPSIZE=.+$'
line: 'CONF_SWAPSIZE=1024'
backup: yes
2024-04-04 14:22:27 +02:00
- name: Install Flatpaks
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-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 comment dtoverlay=vc4-kms-v3d
replace:
path: /boot/config.txt
2022-12-15 22:36:17 +01:00
regexp: '(^dtoverlay=vc4-kms-v3d$)'
replace: '#\1'
- 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: |
2022-12-15 18:34:29 +01:00
gpu_mem=256
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-12-15 11:29:28 +01:00
[pi2]
dtoverlay=vc4-fkms-v3d,cma-256
2022-12-15 11:29:28 +01:00
arm_freq=1000
sdram_freq=500
core_freq=500
over_voltage=4
[pi3]
2022-12-15 12:06:09 +01:00
dtoverlay=vc4-fkms-v3d,cma-256
2022-12-17 10:50:11 +01:00
arm_freq=1100
2022-12-17 10:13:08 +01:00
core_freq=500
sdram_freq=500
over_voltage=4
2022-12-15 11:29:28 +01:00
[pi4]
2022-12-15 22:48:39 +01:00
dtoverlay=vc4-kms-v3d,cma-256
2022-10-25 16:23:35 +02:00
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
2024-04-03 14:37:05 +02:00
autologin-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
2024-04-03 14:27:54 +02:00
- name: 'remove smartmontools from startup'
command: systemctl disable smartmontools
args:
removes: /etc/systemd/system/smartd.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