From 821d359cb27f4dd5c71a4309b752b97d14316d42 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Tue, 2 Apr 2024 01:21:46 +0200 Subject: add quick and dirty role for ontime --- dan/ele-companion-raspi.yml | 1 + inventory/host_vars/ele-companion-raspi.yml | 7 +++++++ roles/streaming/ontime/defaults/main.yml | 7 +++++++ roles/streaming/ontime/tasks/main.yml | 25 ++++++++++++++++++++++++ roles/streaming/ontime/templates/pod-spec.yml.j2 | 19 ++++++++++++++++++ 5 files changed, 59 insertions(+) create mode 100644 roles/streaming/ontime/defaults/main.yml create mode 100644 roles/streaming/ontime/tasks/main.yml create mode 100644 roles/streaming/ontime/templates/pod-spec.yml.j2 diff --git a/dan/ele-companion-raspi.yml b/dan/ele-companion-raspi.yml index e8ab62e6..e16c4d70 100644 --- a/dan/ele-companion-raspi.yml +++ b/dan/ele-companion-raspi.yml @@ -15,6 +15,7 @@ - role: kubernetes/base - role: kubernetes/standalone/base - role: streaming/companion + - role: streaming/ontime post_tasks: - name: install vlan package apt: diff --git a/inventory/host_vars/ele-companion-raspi.yml b/inventory/host_vars/ele-companion-raspi.yml index 72537079..c3c98d64 100644 --- a/inventory/host_vars/ele-companion-raspi.yml +++ b/inventory/host_vars/ele-companion-raspi.yml @@ -41,3 +41,10 @@ companion_storage: dest: /srv/companion companion_version: 3.2.2 + + +ontime_storage: + type: directory + dest: /srv/ontime + +ontime_version: 2.28.17 diff --git a/roles/streaming/ontime/defaults/main.yml b/roles/streaming/ontime/defaults/main.yml new file mode 100644 index 00000000..5a47afb3 --- /dev/null +++ b/roles/streaming/ontime/defaults/main.yml @@ -0,0 +1,7 @@ +--- +# ontime_storage: +# type: ... + +# ontime_version: 2.28.17 + +ontime_timezone: "Europe/Vienna" diff --git a/roles/streaming/ontime/tasks/main.yml b/roles/streaming/ontime/tasks/main.yml new file mode 100644 index 00000000..3153cc2b --- /dev/null +++ b/roles/streaming/ontime/tasks/main.yml @@ -0,0 +1,25 @@ +--- +- name: prepare storage volume + vars: + storage_volume: "{{ ontime_storage }}" + include_role: + name: "storage/{{ ontime_storage.type }}/volume" + +- set_fact: + ontime_basepath: "{{ storage_volume_mountpoint }}" + +- name: create data/secrets directories + file: + path: "{{ ontime_basepath }}/db" + state: directory + mode: 0750 + owner: app + group: app + +- name: install pod manifest + vars: + kubernetes_standalone_pod: + name: ontime + spec: "{{ lookup('template', 'pod-spec.yml.j2') }}" + include_role: + name: kubernetes/standalone/pod diff --git a/roles/streaming/ontime/templates/pod-spec.yml.j2 b/roles/streaming/ontime/templates/pod-spec.yml.j2 new file mode 100644 index 00000000..7b8ed70e --- /dev/null +++ b/roles/streaming/ontime/templates/pod-spec.yml.j2 @@ -0,0 +1,19 @@ +hostNetwork: true +containers: +- name: ontime + image: getontime/ontime:v{{ ontime_version }} + imagePullPolicy: Always +# securityContext: +# runAsUser: 990 +# runAsGroup: 990 + volumeMounts: + - name: db + mountPath: /external/db + env: + - name: TZ + value: "{{ ontime_timezone }}" +volumes: +- name: db + hostPath: + type: Directory + path: "{{ ontime_basepath }}/db" -- cgit v1.2.3