diff options
author | Christian Pointner <equinox@spreadspace.org> | 2022-05-29 01:32:33 +0200 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2022-05-29 01:32:33 +0200 |
commit | 9714f9dfa1eea2264e8b6a02cd7e7d1a123e4730 (patch) | |
tree | 9424cd34097ca4576bbb4a11b93fa5c8ec71e602 /roles/streaming/streamer/rtmp/tasks | |
parent | rtmp/streamer: move to new encoding scripts (diff) |
rename role rtmp/streamer to streamer/rtmp
Diffstat (limited to 'roles/streaming/streamer/rtmp/tasks')
-rw-r--r-- | roles/streaming/streamer/rtmp/tasks/main.yml | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/roles/streaming/streamer/rtmp/tasks/main.yml b/roles/streaming/streamer/rtmp/tasks/main.yml new file mode 100644 index 00000000..9259fbd4 --- /dev/null +++ b/roles/streaming/streamer/rtmp/tasks/main.yml @@ -0,0 +1,45 @@ +--- +- name: prepare rtmp-streamer storage volume + when: streamer_rtmp_storage is defined + vars: + storage_volume: "{{ streamer_rtmp_storage | combine({'dest': streamer_rtmp_base_path}) }}" + include_role: + name: "storage/{{ streamer_rtmp_storage.type }}/volume" + +- name: create rtmp-streamer instance directory + file: + path: "{{ streamer_rtmp_base_path }}/{{ streamer_rtmp_inst_name }}" + state: directory + +- name: generate nginx config + template: + src: nginx.conf.j2 + dest: "{{ streamer_rtmp_base_path }}/{{ streamer_rtmp_inst_name }}/nginx.conf" + +- name: generate streamer config + copy: + content: "{{ streamer_rtmp_config | combine({'rtmp': {'base_url': 'rtmp://127.0.0.1/'+streamer_rtmp_app_name}}) | to_nice_yaml }}\n" + dest: "{{ streamer_rtmp_base_path }}/{{ streamer_rtmp_inst_name }}/config.yml" + +- name: create recording directory + when: streamer_rtmp_recording is defined + file: + path: "{{ streamer_rtmp_base_path }}/{{ streamer_rtmp_inst_name }}/recordings" + state: directory + owner: app + group: app + +- name: install pod manifest + vars: + kubernetes_standalone_pod: + name: "rtmp-streamer-{{ streamer_rtmp_inst_name }}" + spec: "{{ lookup('template', 'pod-spec.yml.j2') }}" + config_hash_items: + - path: "{{ streamer_rtmp_base_path }}/{{ streamer_rtmp_inst_name }}/nginx.conf" + properties: + - checksum + - path: "{{ streamer_rtmp_base_path }}/{{ streamer_rtmp_inst_name }}/config.yml" + properties: + - checksum + include_role: + name: kubernetes/standalone/pod |