summaryrefslogtreecommitdiff
path: root/roles/streaming/rtmp
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2021-04-04 04:09:17 +0200
committerChristian Pointner <equinox@spreadspace.org>2021-04-04 04:09:17 +0200
commitaacbfb831930a4546e373121785065edc1b35d39 (patch)
tree6a6df055a694ba99842854b7cc05bd9d09792024 /roles/streaming/rtmp
parentadd storage/lvm/groups (diff)
port streaming/rtmp/streamer to new storage volume roles
Diffstat (limited to 'roles/streaming/rtmp')
-rw-r--r--roles/streaming/rtmp/streamer/defaults/main.yml5
-rw-r--r--roles/streaming/rtmp/streamer/tasks/lvm.yml18
-rw-r--r--roles/streaming/rtmp/streamer/tasks/main.yml13
-rw-r--r--roles/streaming/rtmp/streamer/tasks/zfs.yml14
4 files changed, 9 insertions, 41 deletions
diff --git a/roles/streaming/rtmp/streamer/defaults/main.yml b/roles/streaming/rtmp/streamer/defaults/main.yml
index c471e5da..95a2ecc2 100644
--- a/roles/streaming/rtmp/streamer/defaults/main.yml
+++ b/roles/streaming/rtmp/streamer/defaults/main.yml
@@ -1,6 +1,7 @@
---
-# rtmp_streamer_lvm:
-# rtmp_streamer_zfs:
+# rtmp_streamer_storage:
+# type: (lvm|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
deleted file mode 100644
index c92d8384..00000000
--- a/roles/streaming/rtmp/streamer/tasks/lvm.yml
+++ /dev/null
@@ -1,18 +0,0 @@
----
-- 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 9c3dd9d6..0e844c72 100644
--- a/roles/streaming/rtmp/streamer/tasks/main.yml
+++ b/roles/streaming/rtmp/streamer/tasks/main.yml
@@ -1,11 +1,10 @@
---
-- 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: prepare rtmp-streamer storage volume
+ when: rtmp_streamer_storage is defined
+ vars:
+ storage_volume: "{{ rtmp_streamer_storage | combine({'dest': rtmp_streamer_base_path})}}"
+ include_role:
+ name: "storage/{{ rtmp_streamer_storage.type }}/volume"
- name: create rtmp-streamer instance directory
file:
diff --git a/roles/streaming/rtmp/streamer/tasks/zfs.yml b/roles/streaming/rtmp/streamer/tasks/zfs.yml
deleted file mode 100644
index 74889cbc..00000000
--- a/roles/streaming/rtmp/streamer/tasks/zfs.yml
+++ /dev/null
@@ -1,14 +0,0 @@
----
-- 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