From adbba116383f39fc2da375fb9c400b1a7f99ffc2 Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Mon, 18 May 2026 13:37:07 -0400 Subject: split plex (alpine) into plex (debian) and radio (debian) --- host_vars/plex.in.freya.cat.yml | 4 +++ host_vars/radio.in.freya.cat | 4 +++ host_vars/vpn.in.freya.cat.yml | 2 +- inventory/hosts | 15 +++++----- reboot.yml | 4 +++ roles/debian/files/plex.sources | 5 ++++ roles/debian/tasks/sources.yml | 46 ++++++++++++++++++++++++++++++ roles/debian/templates/debian.sources.j2 | 15 ++-------- roles/debian/templates/jellyfin.sources.j2 | 5 ++++ roles/reboot/tasks/main.yml | 3 ++ roles/update/tasks/main.yml | 4 +++ update.yml | 1 - 12 files changed, 87 insertions(+), 21 deletions(-) create mode 100644 host_vars/radio.in.freya.cat create mode 100644 reboot.yml create mode 100644 roles/debian/files/plex.sources create mode 100644 roles/debian/templates/jellyfin.sources.j2 create mode 100644 roles/reboot/tasks/main.yml diff --git a/host_vars/plex.in.freya.cat.yml b/host_vars/plex.in.freya.cat.yml index a444cbe..d69cad5 100644 --- a/host_vars/plex.in.freya.cat.yml +++ b/host_vars/plex.in.freya.cat.yml @@ -1 +1,5 @@ net_address_suffix: 7 + +# enable apt repos +apt_plex: 'y' +apt_jellyfin: 'y' diff --git a/host_vars/radio.in.freya.cat b/host_vars/radio.in.freya.cat new file mode 100644 index 0000000..194c3ca --- /dev/null +++ b/host_vars/radio.in.freya.cat @@ -0,0 +1,4 @@ +net_address_suffix: 18 + +# azuracast works better with nginx +disable_caddy: 'y' diff --git a/host_vars/vpn.in.freya.cat.yml b/host_vars/vpn.in.freya.cat.yml index ad30b7e..8d3fee3 100644 --- a/host_vars/vpn.in.freya.cat.yml +++ b/host_vars/vpn.in.freya.cat.yml @@ -1 +1 @@ -net_address_suffix; 12 +net_address_suffix: 12 diff --git a/inventory/hosts b/inventory/hosts index 2acebb3..af98d00 100644 --- a/inventory/hosts +++ b/inventory/hosts @@ -1,21 +1,22 @@ [alpine] auth.in.freya.cat -cloud.in.freya.cat -services.in.freya.cat -plex.in.freya.cat ca.in.freya.cat +cloud.in.freya.cat +cron.in.freya.cat +git.in.freya.cat +matrix.in.freya.cat minecraft.in.freya.cat radius.in.freya.cat +services.in.freya.cat sip.in.freya.cat -git.in.freya.cat -matrix.in.freya.cat -xmpp.in.freya.cat vpn.in.freya.cat -cron.in.freya.cat +xmpp.in.freya.cat [debian] jenkins.in.freya.cat owntracks.in.freya.cat +plex.in.freya.cat +radio.in.freya.cat [all:vars] ansible_user=root diff --git a/reboot.yml b/reboot.yml new file mode 100644 index 0000000..3d9df19 --- /dev/null +++ b/reboot.yml @@ -0,0 +1,4 @@ +- name: Reboot VMs + hosts: all + roles: + - reboot diff --git a/roles/debian/files/plex.sources b/roles/debian/files/plex.sources new file mode 100644 index 0000000..d5a62d7 --- /dev/null +++ b/roles/debian/files/plex.sources @@ -0,0 +1,5 @@ +Types: deb +URIs: https://repo.plex.tv/deb/ +Suites: public +Components: main +Signed-By: /usr/share/keyrings/plex.asc diff --git a/roles/debian/tasks/sources.yml b/roles/debian/tasks/sources.yml index 813c3db..3a5f182 100644 --- a/roles/debian/tasks/sources.yml +++ b/roles/debian/tasks/sources.yml @@ -69,6 +69,52 @@ mode: '0644' when: jenkins.stat.exists or apt_jenkins is defined +# Setup Plex + +- name: Check for plex repo + stat: + path: /etc/apt/sources.list.d/plex.sources + register: plex + +- name: Configure Plex APT repositories + copy: + src: plex.sources + dest: /etc/apt/sources.list.d/plex.sources + owner: root + group: root + mode: '0664' + when: plex.stat.exists or apt_plex is defined + +- name: Install Plex GPG key + get_url: + url: https://downloads.plex.tv/plex-keys/PlexSign.v2.key + dest: /usr/share/keyrings/plex.asc + mode: '0644' + when: plex.stat.exists or apt_plex is defined + +# Setup Jellyfin + +- name: Check for jellyfin repo + stat: + path: /etc/apt/sources.list.d/jellyfin.sources + register: jellyfin + +- name: Configure Jellyfin APT repositories + template: + src: jellyfin.sources.j2 + dest: /etc/apt/sources.list.d/jellyfin.sources + owner: root + group: root + mode: '0664' + when: jellyfin.stat.exists or apt_plex is defined + +- name: Install Jellyfin GPG key + get_url: + url: https://repo.jellyfin.org/jellyfin_team.gpg.key + dest: /usr/share/keyrings/jellyfin.asc + mode: '0644' + when: jellyfin.stat.exists or apt_plex is defined + # Finally update apt - name: Update APT cache diff --git a/roles/debian/templates/debian.sources.j2 b/roles/debian/templates/debian.sources.j2 index 097c32b..f609d8a 100644 --- a/roles/debian/templates/debian.sources.j2 +++ b/roles/debian/templates/debian.sources.j2 @@ -1,20 +1,11 @@ -# Modernized from /etc/apt/sources.list Types: deb deb-src URIs: http://deb.debian.org/debian/ -Suites: {{ debian_version }} -Components: main non-free-firmware +Suites: {{ debian_version }} {{ debian_version }}-updates {{ debian_version }}-backports +Components: main contrib non-free Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg -# Modernized from /etc/apt/sources.list Types: deb deb-src URIs: http://security.debian.org/debian-security/ Suites: {{ debian_version }}-security -Components: main non-free-firmware -Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg - -# Modernized from /etc/apt/sources.list -Types: deb deb-src -URIs: http://deb.debian.org/debian/ -Suites: {{ debian_version }}-updates -Components: main non-free-firmware +Components: main contrib non-free Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg diff --git a/roles/debian/templates/jellyfin.sources.j2 b/roles/debian/templates/jellyfin.sources.j2 new file mode 100644 index 0000000..633f9f5 --- /dev/null +++ b/roles/debian/templates/jellyfin.sources.j2 @@ -0,0 +1,5 @@ +Types: deb +URIs: https://repo.jellyfin.org/debian +Suites: {{ debian_version }} +Components: main +Signed-By: /usr/share/keyrings/jellyfin.asc diff --git a/roles/reboot/tasks/main.yml b/roles/reboot/tasks/main.yml new file mode 100644 index 0000000..f0c02b3 --- /dev/null +++ b/roles/reboot/tasks/main.yml @@ -0,0 +1,3 @@ + +- name: Reboot the system + reboot: diff --git a/roles/update/tasks/main.yml b/roles/update/tasks/main.yml index c64d3c2..4222661 100644 --- a/roles/update/tasks/main.yml +++ b/roles/update/tasks/main.yml @@ -2,3 +2,7 @@ - name: Update Alpine include_tasks: alpine.yml when: "'alpine' in group_names" + +- name: Update Debian + include_tasks: debian.yml + when: "'debian' in group_names" diff --git a/update.yml b/update.yml index 76ff081..21840cd 100644 --- a/update.yml +++ b/update.yml @@ -1,5 +1,4 @@ - name: Update VMs hosts: all - become: true roles: - update -- cgit v1.3.1-freya