feat: Jellyfin

This commit is contained in:
Lino Silva
2025-05-09 16:55:40 +01:00
parent e0eeab18d0
commit 73db11b853
14 changed files with 141 additions and 62 deletions
@@ -1,8 +1,12 @@
---
# Unable to use ansible.builtin.lineinfile, because we need to run this through the proxmox host (because SSH is not enabled duh)
- name: Pause for 10 seconds to wait for SSH server
ansible.builtin.pause:
seconds: 10
- name: Allow SSH into LXC
ansible.builtin.command: lxc-attach -n 610 -- sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
ansible.builtin.command: lxc-attach -n 642 -- sed -i "s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g" /etc/ssh/sshd_config
- name: Restart SSH Service
ansible.builtin.command: lxc-attach -n 610 service ssh restart
ansible.builtin.command: lxc-attach -n 642 service ssh restart
@@ -0,0 +1,20 @@
---
- name: Create directory for docker-compose
ansible.builtin.file:
path: /root/docker/
state: directory
mode: "0755"
- name: Copy docker-compose file
template:
src: "docker-compose.yml"
dest: /root/docker/docker-compose.yml
owner: root
group: root
mode: 0755
- name: Run docker-compose
ansible.builtin.shell:
args:
cmd: docker compose up -d
chdir: /root/docker/
@@ -0,0 +1,19 @@
services:
jellyfin:
image: lscr.io/linuxserver/jellyfin:latest
container_name: jellyfin
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/Lisbon
- JELLYFIN_PublishedServerUrl=https://media.lino.cooking #optional
volumes:
- /data:/config
- /media/tv:/data/tvshows
- /media/movies:/data/movies
ports:
- 8096:8096
- 8920:8920 #optional
- 7359:7359/udp #optional
- 1900:1900/udp #optional
restart: unless-stopped
@@ -0,0 +1,27 @@
---
- name: Get convenience script
uri:
url: "https://get.docker.com"
method: GET
dest: /tmp/get-docker.sh
mode: a+x
creates: /tmp/get-docker.sh
- name: Execute script
ansible.builtin.shell: /tmp/get-docker.sh
- name: Ensure group "docker" exists
ansible.builtin.group:
name: docker
state: present
- name: Add root user to docker group
ansible.builtin.user:
name: root
groups: docker
append: yes
- name: Enable docker on startup
ansible.builtin.shell: |
systemctl enable docker.service
systemctl enable containerd.service
@@ -0,0 +1,30 @@
---
- name: Create container
community.general.proxmox:
vmid: 642
node: purah
api_user: root@pam
api_password: "{{ proxmox_api_password }}"
api_host: 10.0.2.2
password: "{{ lxc_password }}"
hostname: jellyfin
ostemplate: "local:vztmpl/debian-12-standard_12.7-1_amd64.tar.zst"
netif: "{'net0':'name=eth0,\
gw=10.0.0.1,\
ip=10.0.2.42/21,\
hwaddr=cc:c6:cf:de:20:42,\
bridge=vmbr0'}"
cores: 4
memory: 4196
unprivileged: no
swap: 0
searchdomain: "home"
onboot: 1
features:
- nesting=1
- keyctl=1
mounts: '{
"mp0":"purah-mirror-860gb:40,mp=/data,backup=1"
}'
disk: purah-mirror-860gb:10
force: yes
@@ -23,4 +23,5 @@
ansible.builtin.lineinfile:
path: /Users/lino.silva/.ssh/known_hosts
state: absent
regexp: "^10.0.2.19"
regexp: "^10.0.2.42"
-12
View File
@@ -1,12 +0,0 @@
---
- name: Download binary
ansible.builtin.shell:
args:
cmd: wget https://download.foldingathome.org/releases/public/release/fahclient/debian-stable-64bit/v7.6/fahclient_7.6.21_amd64.deb
chdir: /root/
- name: Install folding
ansible.builtin.shell:
args:
cmd: dpkg -i --force-depends fahclient_7.6.21_amd64.deb
chdir: /root/
@@ -1,24 +0,0 @@
---
- name: Create container
community.general.proxmox:
vmid: 610
node: hyrule
api_user: root@pam
api_password: "{{ proxmox_api_password }}"
api_host: 10.0.2.2
password: "{{ lxc_password }}"
hostname: folding
ostemplate: "hyrule-8tb-nfs:vztmpl/debian-11-standard_11.3-1_amd64.tar.zst"
netif: "{'net0':'name=eth0,\
gw=10.0.0.1,\
ip=10.0.2.19/21,\
hwaddr=cc:c6:cf:de:17:79,\
bridge=vmbr0'}"
cores: 12
memory: 30720
unprivileged: no
swap: 0
searchdomain: "home"
onboot: 1
disk: ssd250:20
force: yes