cosmos kiosk playbook

This commit is contained in:
2025-09-28 11:26:45 -07:00
parent 6f4fcb90e2
commit 320ffa8393
7 changed files with 135 additions and 43 deletions

46
VCR-capture.yaml Normal file
View File

@ -0,0 +1,46 @@
---
- name: Cosmos VCR Capture
hosts: all
become: yes
vars:
create_data_dir: true
kiosk_service_templates:
- chrome_website: "http://localhost:8081"
service_name: user_stream_control
service_description: "VCR Capture User Stream Control"
extra_service_configs: ""
user_data_dir: "/opt/chrome/one"
extra_chrome_configs: |
--window-size="470,1080" \
--user-data-dir=/opt/chrome/one \
- chrome_website: "http://localhost:8888/stream"
service_name: stream_preview
service_description: "VCR Capture Preview Stream"
extra_service_configs: ""
user_data_dir: "/opt/chrome/two"
extra_chrome_configs: |
--window-size="1440,1080" \
--user-data-dir=/opt/chrome/two \
--window-position="480,0" \
roles:
- role: cosmos_init
when: not refresh_special | bool
- role: docker_workstation
when: not refresh_special | bool
- role: nvidia_drivers
when: install_nvidia | bool and not refresh_special | bool
- role: video_capture
- role: chrome_kiosk
when: GUI_deploy | bool
...

16
cosmos-kiosk.yaml Normal file
View File

@ -0,0 +1,16 @@
---
- name: Cosmos Kiosk Pipeline
hosts: all
become: yes
roles:
- role: cosmos_init
when: not refresh_special | bool
- role: docker_workstation
when: install_docker | bool and not refresh_special | bool
- role: chrome_kiosk
...

View File

@ -4,26 +4,6 @@
become: yes
vars:
iso_only: true
servers:
# make sure this lines up with the Jenkinsfile
- name: Octoprint
role: octoprint
- name: Kodi
role: kodi
- name: Timelapse
role: timelapse
- name: Build ISO
role: pxe_server
- name: Jenkins VPN
role: jenkins_vpn
- name: Puck VPN
role: puck_vpn
- name: Net Bridge
role: net_bridge
- name: Carputer
role: carputer
- name: VCR Capture
role: video_capture
roles:
- role: cosmos_init
@ -33,11 +13,13 @@
when: install_docker | bool and not refresh_special | bool
- role: nvidia_drivers
when: install_nvidia | bool and not refresh_special | bool
when: install_nvidia | bool and not refresh_special | bool and not skip_nvidia | bool
- role: ldap_client
when: install_LDAP | bool and not refresh_special | bool
# - role: special_server
tasks:
- name: display special_server
@ -46,12 +28,14 @@
- name: Run the appropriate role based on server type
include_role:
name: "{{ servers_item.role }}"
when: special_server | regex_search("{{ servers_item.name }}")
loop: "{{ servers }}"
loop_control:
loop_var: servers_item
name: "{{ special_server }}"
when: '"none" not in special_server'
# when: special_server | regex_search("{{ servers_item.name }}")
# loop: "{{ servers }}"
# loop_control:
# loop_var: servers_item
#
# - { role: octoprint, when: special_server | regex_search("Octoprint") }
# - { role: kodi, when: special_server | regex_search("Kodi") }
# - { role: timelapse, when: special_server | regex_search("Timelapse") }

View File

@ -3,6 +3,17 @@
hosts: all
become: yes
vars:
kiosk_service_templates:
- chrome_website: "http://127.0.0.1"
service_name: "stream_preview"
service_description: "VCR Capture Preview Stream"
extra_service_configs: |
After=lldp_api.service
After=sddm.service
extra_chrome_configs: "{{ fixed_size }}"
# Required Jenkins Vars
# host_ip - string
# new_hostname - string
@ -15,7 +26,8 @@
when: not refresh_only | bool
- role: lldp_scan
- role: chrome_kiosk

View File

@ -1,5 +1,5 @@
---
# https://www.youtube.com/watch?v=GuTcle5edjk
- name: Mattgpt Container Capture
hosts: all
become: yes

View File

@ -7,6 +7,7 @@
#vpn_endpoint: "172.30.2.1"
#gather_only: true
#cpu_architecture: "amd64"
#armcpu_check: false
#AUTH_API_KEY: hellothere
#fprint_sensor: duybluey
#ultimaker_cura_url: "https://ultimaker.com/software/ultimaker-cura/"
@ -16,15 +17,48 @@
#terse_packages: false
#install_packages: false
#build_iso: false
ding_api: true
refresh_special: true
#ding_api: true
#refresh_special: false
#create_data_dir: true
#python_packages:
#- python3
#- python3-pip
#- python3-dev
#- python3-setuptools
#- python3-venv
#kiosk_service_templates:
# - chrome_website: "http://172.20.6.27:8081"
# service_name: user_stream_control
# service_description: "VCR Capture User Stream Control"
# extra_service_configs: ""
# user_data_dir: "/opt/chrome/one"
# extra_chrome_configs: |
# --window-size="470,1080" \
# --user-data-dir=/opt/chrome/one \
# - chrome_website: "http://172.20.6.27:8888/stream"
# service_name: stream_preview
# service_description: "VCR Capture Preview Stream"
# extra_service_configs: ""
# user_data_dir: "/opt/chrome/two"
# extra_chrome_configs: |
# --window-size="1440,1080" \
# --user-data-dir=/opt/chrome/two \
# --window-position="480,0" \
# roles:
# - video_capture
# - chrome_kiosk
tasks:
- name: include vars
ansible.builtin.include_vars:
file: /var/jenkins_home/ansible/roles/chrome_kiosk/files/kiosk.yaml
name: kiosk_vars
- debug:
msg: "{{ kiosk_vars.kiosk_service_templates }}"
# tasks:
#
# - name: prereqs - get debian version info
# shell: 'cat /etc/os-release | grep VERSION_ID | cut -d\" -f2'
@ -35,8 +69,8 @@
# /var/jenkins_home/ansible-files/lldp_scan/cosmos-deb{{ os_version_id_output.stdout_lines[0] }}.tar.gz
# - name: Rename Endpoint
# include_tasks: /var/jenkins_home/ansible/roles/install_apps/tasks/ultimaker.yaml
# - name: docker nvidia
# include_tasks: /var/jenkins_home/ansible/roles/nvidia_drivers/tasks/docker.yaml
...

View File

@ -33,16 +33,16 @@
loop: "{{ ansible_mounts }}"
when: item.mount == "/"
- name: All apt packages up to date
- name: Perform apt upgrade
apt:
upgrade: dist
update_cache: yes
- name: apt autoremove
- name: Perform apt autoremove
apt:
autoremove: yes
- name: apt clean
- name: Perform apt clean
apt:
clean: yes
@ -62,7 +62,7 @@
test_command: whoami
when: reboot_required_file.stat.exists
- name: Switch OS from bookworm to trixie
- name: Update OS in sources.list
ansible.builtin.replace:
path: /etc/apt/sources.list
regexp: 'bookworm'
@ -84,7 +84,7 @@
loop_control:
label: "{{ item.path }}"
- name: Use apt to move to trixie
- name: Perform apt upgrade, moving to Trixie
apt:
upgrade: dist
update_cache: yes
@ -99,15 +99,15 @@
- ansible_distribution_major_version == '13'
fail_msg: "Upgrade to Debian 13 failed"
- name: apt autoremove
- name: Perform apt autoremove
apt:
autoremove: yes
- name: apt clean
- name: Perform apt clean
apt:
clean: yes
- name: Reboot on trixie
- name: Reboot to trixie
ansible.builtin.reboot:
msg: "Reboot initiated by Ansible"
connect_timeout: 5