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 become: yes
vars: vars:
iso_only: true 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: roles:
- role: cosmos_init - role: cosmos_init
@ -33,11 +13,13 @@
when: install_docker | bool and not refresh_special | bool when: install_docker | bool and not refresh_special | bool
- role: nvidia_drivers - 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 - role: ldap_client
when: install_LDAP | bool and not refresh_special | bool when: install_LDAP | bool and not refresh_special | bool
# - role: special_server
tasks: tasks:
- name: display special_server - name: display special_server
@ -46,12 +28,14 @@
- name: Run the appropriate role based on server type - name: Run the appropriate role based on server type
include_role: include_role:
name: "{{ servers_item.role }}" name: "{{ special_server }}"
when: special_server | regex_search("{{ servers_item.name }}") when: '"none" not in special_server'
loop: "{{ servers }}"
loop_control:
loop_var: servers_item
# 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: octoprint, when: special_server | regex_search("Octoprint") }
# - { role: kodi, when: special_server | regex_search("Kodi") } # - { role: kodi, when: special_server | regex_search("Kodi") }
# - { role: timelapse, when: special_server | regex_search("Timelapse") } # - { role: timelapse, when: special_server | regex_search("Timelapse") }

View File

@ -3,6 +3,17 @@
hosts: all hosts: all
become: yes 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 # Required Jenkins Vars
# host_ip - string # host_ip - string
# new_hostname - string # new_hostname - string
@ -16,6 +27,7 @@
- role: lldp_scan - role: lldp_scan
- role: chrome_kiosk

View File

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

View File

@ -7,6 +7,7 @@
#vpn_endpoint: "172.30.2.1" #vpn_endpoint: "172.30.2.1"
#gather_only: true #gather_only: true
#cpu_architecture: "amd64" #cpu_architecture: "amd64"
#armcpu_check: false
#AUTH_API_KEY: hellothere #AUTH_API_KEY: hellothere
#fprint_sensor: duybluey #fprint_sensor: duybluey
#ultimaker_cura_url: "https://ultimaker.com/software/ultimaker-cura/" #ultimaker_cura_url: "https://ultimaker.com/software/ultimaker-cura/"
@ -16,15 +17,48 @@
#terse_packages: false #terse_packages: false
#install_packages: false #install_packages: false
#build_iso: false #build_iso: false
ding_api: true #ding_api: true
refresh_special: 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: # 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 # - name: prereqs - get debian version info
# shell: 'cat /etc/os-release | grep VERSION_ID | cut -d\" -f2' # 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 # /var/jenkins_home/ansible-files/lldp_scan/cosmos-deb{{ os_version_id_output.stdout_lines[0] }}.tar.gz
# - name: Rename Endpoint # - name: docker nvidia
# include_tasks: /var/jenkins_home/ansible/roles/install_apps/tasks/ultimaker.yaml # include_tasks: /var/jenkins_home/ansible/roles/nvidia_drivers/tasks/docker.yaml
... ...

View File

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