summaryrefslogtreecommitdiff
path: root/roles/streaming/rtmp
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2021-04-03 00:06:41 +0200
committerChristian Pointner <equinox@spreadspace.org>2021-04-03 00:06:41 +0200
commit1d944045d137d2e3e5bf8e51d70b3b51113fa795 (patch)
tree1e5631b91475b1b294958747918f617095270c3b /roles/streaming/rtmp
parentglt: test higher feed bitrates to c3voc (diff)
enable recording to glt-dione and glt-helene
Diffstat (limited to 'roles/streaming/rtmp')
-rw-r--r--roles/streaming/rtmp/streamer/defaults/main.yml2
-rw-r--r--roles/streaming/rtmp/streamer/tasks/lvm.yml18
-rw-r--r--roles/streaming/rtmp/streamer/tasks/main.yml8
-rw-r--r--roles/streaming/rtmp/streamer/tasks/zfs.yml14
4 files changed, 42 insertions, 0 deletions
diff --git a/roles/streaming/rtmp/streamer/defaults/main.yml b/roles/streaming/rtmp/streamer/defaults/main.yml
index fc9f644f..c471e5da 100644
--- a/roles/streaming/rtmp/streamer/defaults/main.yml
+++ b/roles/streaming/rtmp/streamer/defaults/main.yml
@@ -1,4 +1,6 @@
---
+# rtmp_streamer_lvm:
+# rtmp_streamer_zfs:
rtmp_streamer_base_path: /srv/rtmp/streamer
rtmp_streamer_port: 1935
diff --git a/roles/streaming/rtmp/streamer/tasks/lvm.yml b/roles/streaming/rtmp/streamer/tasks/lvm.yml
new file mode 100644
index 00000000..c92d8384
--- /dev/null
+++ b/roles/streaming/rtmp/streamer/tasks/lvm.yml
@@ -0,0 +1,18 @@
+---
+- name: create logical volume
+ lvol:
+ vg: "{{ rtmp_streamer_lvm.vg }}"
+ lv: "{{ rtmp_streamer_lvm.lv }}"
+ size: "{{ rtmp_streamer_lvm.size }}"
+
+- name: create filesystem
+ filesystem:
+ fstype: "{{ rtmp_streamer_lvm.fs }}"
+ dev: "/dev/mapper/{{ rtmp_streamer_lvm.vg | replace('-', '--') }}-{{ rtmp_streamer_lvm.lv | replace('-', '--') }}"
+
+- name: mount filesytem
+ mount:
+ src: "/dev/mapper/{{ rtmp_streamer_lvm.vg | replace('-', '--') }}-{{ rtmp_streamer_lvm.lv | replace('-', '--') }}"
+ path: "{{ rtmp_streamer_base_path }}"
+ fstype: "{{ rtmp_streamer_lvm.fs }}"
+ state: mounted
diff --git a/roles/streaming/rtmp/streamer/tasks/main.yml b/roles/streaming/rtmp/streamer/tasks/main.yml
index e63bbdce..9c3dd9d6 100644
--- a/roles/streaming/rtmp/streamer/tasks/main.yml
+++ b/roles/streaming/rtmp/streamer/tasks/main.yml
@@ -1,4 +1,12 @@
---
+- name: prepare rtmp-streamer base path as LVM
+ when: rtmp_streamer_lvm is defined
+ import_tasks: lvm.yml
+
+- name: prepare rtmp-streamer base path as ZFS dataset
+ when: rtmp_streamer_zfs is defined
+ import_tasks: zfs.yml
+
- name: create rtmp-streamer instance directory
file:
path: "{{ rtmp_streamer_base_path }}/{{ rtmp_streamer_inst_name }}"
diff --git a/roles/streaming/rtmp/streamer/tasks/zfs.yml b/roles/streaming/rtmp/streamer/tasks/zfs.yml
new file mode 100644
index 00000000..74889cbc
--- /dev/null
+++ b/roles/streaming/rtmp/streamer/tasks/zfs.yml
@@ -0,0 +1,14 @@
+---
+- name: create zfs dataset
+ zfs:
+ name: "{{ rtmp_streamer_zfs.pool }}/{{ rtmp_streamer_zfs.name }}"
+ state: present
+ extra_zfs_properties: "{{ rtmp_streamer_zfs.properties | default(omit) }}"
+
+- name: bind mount filesytem
+ mount:
+ src: "{{ zfs_pools[rtmp_streamer_zfs.pool].mountpoint }}/{{ rtmp_streamer_zfs.name }}"
+ path: "{{ rtmp_streamer_base_path }}"
+ fstype: none
+ opts: bind,x-systemd.automount,nofail
+ state: mounted