release candidate

This commit is contained in:
2025-10-12 16:50:32 -07:00
parent 3432e8ac9f
commit 699d7f54c8
20 changed files with 415 additions and 150 deletions

22
tasks/arm_gui_check.yaml Normal file
View File

@ -0,0 +1,22 @@
---
# need to put this little guy in a file to do a loop
- name: Video Capture - run product command
shell: "lspci | grep '{{ arm_gui_list_item }}' | head -n 1 | awk {'print $8'}"
register: prod_name_output
- name: Video Capture - check for output
ignore_errors: yes
debug:
msg: "System Info: {{prod_name_output.stdout_lines[0] }}"
- name: Video Capture - Check for GUI-approved platform
ignore_errors: yes
set_fact:
GUI_deploy: "{{ prod_name_output.stdout_lines[0] in kiosk_models }}"
arm_device_found: true
...

View File

@ -4,6 +4,12 @@
# Install Jellyfin
###############################################
- name: jellyfin - stop and delete container if running
ignore_errors: true
shell: |
docker stop jellyfin
docker rm jellyfin
- name: jellyfin - create folder
file:
path: "{{ jellyfin_working_folder }}"
@ -12,6 +18,7 @@
# Extract jellyfin configs
- name: jellyfin - Extract jellyfin.tar.gz
when: not refresh_special | bool
unarchive:
src: jellyfin.tar.gz
dest: "/opt/cosmos"
@ -28,10 +35,11 @@
- name: "jellyfin - Start container at {{ jellyfin_port }}"
shell: "docker-compose -f {{ jellyfin_working_folder }}/docker-compose.yaml up -d"
register: jellyfin_output
- debug:
msg:
- "Docker compose output:"
- "{{ jellyfin_output.stdout_lines }}"
- "{{ jellyfin_output.stderr_lines }}"
#- debug:
# msg:
# - "Docker compose output:"
# - "{{ jellyfin_output.stdout_lines }}"
# - "{{ jellyfin_output.stderr_lines }}"
...

View File

@ -1,43 +0,0 @@
---
- name: Kiosk - get Product Name
shell: "dmidecode | grep -A3 'System Info' | grep Product | cut -d: -f2 | cut -b2-"
register: prod_name_output
- name: Kiosk - Check for approved platform
set_fact:
install_sddm: "{{ prod_name_output.stdout_lines[0] in kiosk_models }}"
- name: Kiosk - Proceed with local kiosk install
when: install_sddm | bool
block:
# install SDDM + Plasma using Kodi role
- name: Kiosk - Install SDDM + KDE
include_role:
- kodi
# Install Chrome
- name: Install chrome
block:
- name: prereqs - Chrome - Check if installed
command: dpkg -l google-chrome-stable
register: chrome_installed
ignore_errors: true
- name: prereqs - Chrome - Set chrome_present variable
set_fact:
chrome_present: "{{ chrome_installed.rc == 0 }}"
- name: prereqs - Install Chrome
include_tasks: /var/jenkins_home/ansible/roles/install_apps/tasks/chrome.yaml
when: not chrome_present | bool
# set up chrome kiosk using lldp_scan role
- name: Kiosk - Install Chrome Kiosk Service
include_role:
- lldp_scan
...

View File

@ -1,4 +1,49 @@
---
- name: Video Capture - Luna Offload Vars
when: luna_offload | bool
set_fact:
mediamtx_remote_ffmpeg: "-f rtsp rtsp://172.20.20.60:8554/stream"
stream_preview_host: "172.20.20.60"
- name: Video Capture - server only Vars
when: server_deploy | bool
set_fact:
stream_preview_host: "172.20.20.60"
stream_control_host: "172.20.20.60"
- name: Video Capture - Local stream vars
when: remote_deploy | bool
set_fact:
mediamtx_local_ffmpeg: "-f rtsp rtsp://172.20.20.60:8554/stream"
- name: Video Capture - Remote stream vars
when: not remote_deploy | bool
set_fact:
mediamtx_local_ffmpeg: "-f rtsp rtsp://localhost:8554/stream"
- name: Video Capture - MediaMTX Only
when: MediaMTX_only | bool
block:
- name: include mediamtx task
include_tasks: mediamtx.yaml
- meta: end_play
- name: Video Capture - Kiosk Only
when: kiosk_refresh | bool
block:
- name: display initial kiosk_service_templates
debug:
msg: "{{ kiosk_service_templates }}"
- name: Run the chrome kiosk role when it's GUI time
include_role:
name: chrome_kiosk
when: GUI_deploy | bool
- meta: end_play
- name: Video Capture - Check arch if needed
when: refresh_special | bool
@ -12,6 +57,41 @@
set_fact:
cpu_architecture: "{{ cpu_architecture_output.stdout_lines[0] }}"
# override GUI_deploy if unauthorized
# if non-1080p resolutions are needed
# chrome configs can be set here on a
# case-by-case basis
- name: Video Capture - get Product Name for x86
when: GUI_deploy | bool and not armcpu_check | bool
block:
- name: Video Capture - run product command
shell: "dmidecode | grep -A3 'System Info' | grep Product | cut -d: -f2 | cut -b2-"
register: prod_name_output
- name: Video Capture - show output
debug:
msg: "System Info: {{prod_name_output.stdout_lines[0] }}"
- name: Video Capture - Check for GUI-approved platform
ignore_errors: yes
set_fact:
GUI_deploy: "{{ prod_name_output.stdout_lines[0] in kiosk_models }}"
- name: Video Capture - get Product Name for arm
when: GUI_deploy | bool and armcpu_check | bool and not arm_device_found | bool
block:
- name: Video capture - arm check loop
loop: "{{ arm_gui_list }}"
loop_control:
loop_var: arm_gui_list_item
include_tasks: arm_gui_check.yaml
- name: Video Capture - Will we GUI?
debug:
msg: "GUI Deploy: {{ GUI_deploy }}"
- name: Video Capture - Run Once Block
when: not refresh_special | bool
block:
@ -26,20 +106,28 @@
loop_var: streamer_packages_items
- name: Video Capture - Working Folder Handler
when: not remote_deploy | bool
include_tasks: working_folder.yaml
- name: Video Capture - Configure MediaMTX
when: not remote_deploy | bool
include_tasks: mediamtx.yaml
- name: Video Capture - Configure Jellyfin
when: '"amd64" in cpu_architecture'
include_tasks: jellyfin.yaml
- name: Video Capture - Configure Streaming
include_tasks: streamer.yaml
- name: Video Capture - Configure service control
when: not remote_deploy | bool
include_tasks: service_control.yaml
- name: Video Capture - Configure Streaming
when: not server_deploy | bool
include_tasks: streamer.yaml
- name: Video Capture - Configure Jellyfin
when: '"amd64" in cpu_architecture and jellyfin_deploy | bool and not remote_deploy | bool'
include_tasks: jellyfin.yaml
- name: Run the chrome kiosk role when it's GUI time
include_role:
name: chrome_kiosk
when: GUI_deploy | bool and not server_deploy | bool
...

View File

@ -18,7 +18,7 @@
group: root
- name: MediaMTX - check for arm
when: '"arm" in cpu_architecture'
when: armcpu_check | bool
set_fact:
mediamtx_architecture: "arm64"

31
tasks/preview.yaml Normal file
View File

@ -0,0 +1,31 @@
---
# this is not just for preview but for capture too
- name: video_capture - streamer - preview - create folder
file:
path: "{{ stream_preview_folder }}"
state: directory
mode: '0755'
- name: video_capture - streamer - preview - copy service script
template:
src: preview_service.sh
dest: "{{ stream_preview_folder }}/preview_service.sh"
mode: 0755
- name: video_capture - streamer - preview - create service file
template:
src: preview_service.service
dest: /etc/systemd/system/preview_service.service
mode: 0644
- name: video_capture - streamer - preview - daemon reload
systemd:
name: preview_service.service
state: started
enabled: yes
daemon_reload: yes
...

View File

@ -151,4 +151,28 @@
msg="{{ docker_output.stdout_lines }}"
msg="{{ docker_output.stderr_lines }}"
# create streaming service
# this used to live with the streamer but i moved it here because most of the time this will be split up
# the names don't make as much sense anymore either...
# oh well...
- name: video_capture - fil - ffmpeg service
#when: false
block:
- name: video_capture - streamer - copy service script
template:
src: stream_service.sh
dest: "{{ streaming_working_folder }}/stream_service.sh"
mode: 0755
- name: video_capture - streamer - create service file
template:
src: stream_service.service
dest: /etc/systemd/system/stream_service.service
mode: 0644
- name: video_capture - streamer - daemon reload
systemd:
daemon_reload: yes
...

View File

@ -10,6 +10,21 @@
mode: '0755'
owner: root
group: root
register: folder_output
- debug:
msg: "{{ folder_output }}"
# Create capture Folder
- name: "video_capture - streamer - create {{ recording_capture_folder }} folder"
file:
path: "{{ recording_capture_folder }}"
state: directory
mode: '0755'
owner: root
group: root
register: folder_output_2
- debug:
msg: "{{ folder_output_2 }}"
# this service shouldn't stay running
- name: video_capture - streamer - stop stream_service if running
@ -35,37 +50,59 @@
# same with video, the lsusb ID is 534d:0021
# v4l2-ctl shows it as "AV TO USB2.0"
# this checks a list and saves the only correct output
- name: video_capture - check for each video device
shell: "v4l2-ctl --list-devices 2> /dev/null | grep -A3 '{{ v4l2_strings }}' | grep video | head -n 1 | awk '{print $1}' || true"
register: v4l2_id_string_check
loop: "{{ v4l2_id_string }}"
loop_control:
loop_var: v4l2_strings
- name: video_capture - get video device
shell: "v4l2-ctl --list-devices 2> /dev/null | grep -A3 '{{ v4l2_id_string }}' | grep video | head -n 1 | awk '{print $1}'"
register: video_ID_0
- name: video_capture - set video_device
set_fact:
video_device: "{{ video_ID_0.stdout_lines[0] }}"
when: video_check_output.stdout | length > 0
set_fact:
video_device: "{{ video_check_output.stdout_lines[0] }}"
no_log: true
loop: "{{ v4l2_id_string_check.results }}"
loop_control:
loop_var: video_check_output
- name: video_capture - show results
debug:
msg:
- "Audio Device: {{ audio_device }}"
- "Video Device: {{ video_device }}"
- name: video_capture - streamer - copy service script
template:
src: stream_service.sh
dest: "{{ streaming_working_folder }}/stream_service.sh"
mode: 0755
# adding the preview service here
- name: video_capture - streamer - preview - ffmpeg service
#when: false
block:
- name: video_capture - streamer - create service file
template:
src: stream_service.service
dest: /etc/systemd/system/stream_service.service
mode: 0644
- name: video_capture - streamer - preview - create folder
file:
path: "{{ stream_preview_folder }}"
state: directory
mode: '0755'
- name: video_capture - streamer - daemon reload
systemd:
daemon_reload: yes
- name: video_capture - streamer - preview - copy service script
template:
src: preview_service.sh
dest: "{{ stream_preview_folder }}/preview_service.sh"
mode: 0755
- name: video_capture - streamer - preview - create service file
template:
src: preview_service.service
dest: /etc/systemd/system/preview_service.service
mode: 0644
- name: video_capture - streamer - preview - daemon reload
systemd:
name: preview_service.service
state: started
enabled: yes
daemon_reload: yes
...

View File

@ -6,7 +6,7 @@
file:
path: "{{ working_storage }}"
state: directory
mode: '0755'
mode: '0777'
owner: root
group: root
@ -20,14 +20,14 @@
storage_unmounted: false
- name: Storage Handler Block
when: storage_unmounted and mount_storge | bool
when: storage_unmounted and mount_storge and extra_storage | bool
block:
# find the device, architecture dependent
# the arm64 is intended for the friendlyelec devices
# which only have one sd slot, but still be careful
- name: Storage Handler - Get Storage Device arm64
when: '"arm64" in cpu_architecture'
when: armcpu_check | bool
block:
- name: Storage Handler - get boot device
@ -39,7 +39,7 @@
# this will choose the first storage device that it finds that isn't the boot device
# be careful and don't run this on an inappropriate host
- name: Storage Handler - Get Storage Device amd64
when: '"amd64" in cpu_architecture'
when: not armcpu_check | bool
block:
- name: Storage Handler - get boot UUID
@ -188,7 +188,7 @@
path: "/etc/samba/smb.conf"
search_string: "/etc/samba/smb.conf.d/vcr_rip.conf"
line: "include = /etc/samba/smb.conf.d/vcr_rip.conf"
insertbefore: '[global]'
insertafter: '### smb.conf.d configs here'
- name: Working Folder - restart smbd
service: