From 1d944045d137d2e3e5bf8e51d70b3b51113fa795 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sat, 3 Apr 2021 00:06:41 +0200 Subject: enable recording to glt-dione and glt-helene --- roles/streaming/rtmp/streamer/defaults/main.yml | 2 ++ roles/streaming/rtmp/streamer/tasks/lvm.yml | 18 ++++++++++++++++++ roles/streaming/rtmp/streamer/tasks/main.yml | 8 ++++++++ roles/streaming/rtmp/streamer/tasks/zfs.yml | 14 ++++++++++++++ 4 files changed, 42 insertions(+) create mode 100644 roles/streaming/rtmp/streamer/tasks/lvm.yml create mode 100644 roles/streaming/rtmp/streamer/tasks/zfs.yml (limited to 'roles/streaming/rtmp') 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 -- cgit v1.2.3