Add Jellyfin media server deployment #77

Merged
eblume merged 5 commits from feature/jellyfin-deployment into main 2026-01-30 16:57:27 -08:00
2 changed files with 40 additions and 0 deletions
Showing only changes of commit 8a1a56aaa8 - Show all commits

Add 1Password integration for Jellyfin API key

- Add pre_task to fetch API key from 1Password
- Update jellyfin_metrics role to write API key file
- Include fallback fetch for --tags jellyfin_metrics runs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Erich Blume 2026-01-30 16:17:35 -08:00

View file

@ -78,6 +78,23 @@
no_log: true
tags: [caddy]
# Jellyfin API key for metrics collection
- name: Fetch Jellyfin API key
ansible.builtin.command:
cmd: op --vault vg6xf6vvfmoh5hqjjhlhbeoaie item get ceywxkcd3z7najsy2nmmbs2vke --fields credential --reveal
delegate_to: localhost
register: _jellyfin_metrics_api_key
changed_when: false
no_log: true
check_mode: false
tags: [jellyfin_metrics]
- name: Set Jellyfin API key fact
ansible.builtin.set_fact:
jellyfin_metrics_api_key: "{{ _jellyfin_metrics_api_key.stdout }}"
no_log: true
tags: [jellyfin_metrics]
roles:
- role: alloy
tags: alloy

View file

@ -1,4 +1,27 @@
---
- name: Fetch Jellyfin API key (when running with --tags jellyfin_metrics)
ansible.builtin.command:
cmd: op --vault vg6xf6vvfmoh5hqjjhlhbeoaie item get ceywxkcd3z7najsy2nmmbs2vke --fields credential --reveal
delegate_to: localhost
register: jellyfin_metrics_api_key_fallback
changed_when: false
no_log: true
check_mode: false
when: jellyfin_metrics_api_key is not defined
- name: Set Jellyfin API key fact (fallback)
ansible.builtin.set_fact:
jellyfin_metrics_api_key: "{{ jellyfin_metrics_api_key_fallback.stdout }}"
no_log: true
when: jellyfin_metrics_api_key is not defined
- name: Write Jellyfin API key file
ansible.builtin.copy:
content: "{{ jellyfin_metrics_api_key }}"
dest: "{{ jellyfin_metrics_api_key_file }}"
mode: '0600'
no_log: true
- name: Ensure bin directory exists
ansible.builtin.file:
path: "{{ jellyfin_metrics_script | dirname }}"