--- - 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 }}" state: directory - name: generate nginx config template: src: nginx.conf.j2 dest: "{{ rtmp_streamer_base_path }}/{{ rtmp_streamer_inst_name }}/nginx.conf" - name: generate streamer config copy: content: "{{ rtmp_streamer_config | combine({'rtmp_base_url': 'rtmp://127.0.0.1/'+rtmp_streamer_app_name}) | to_nice_yaml }}\n" dest: "{{ rtmp_streamer_base_path }}/{{ rtmp_streamer_inst_name }}/config.yml" - name: enable recording when: rtmp_streamer_recording_enabled | bool block: - name: create recording directory file: path: "{{ rtmp_streamer_base_path }}/{{ rtmp_streamer_inst_name }}/recordings" state: directory owner: app group: app - name: generate recording script template: src: record.sh.j2 dest: "{{ rtmp_streamer_base_path }}/{{ rtmp_streamer_inst_name }}/record.sh" mode: 0755 - name: install pod manifest vars: kubernetes_standalone_pod: name: "rtmp-streamer-{{ rtmp_streamer_inst_name }}" spec: "{{ lookup('template', 'pod-spec.yml.j2') }}" config_hash_items: - path: "{{ rtmp_streamer_base_path }}/{{ rtmp_streamer_inst_name }}/nginx.conf" properties: - checksum - path: "{{ rtmp_streamer_base_path }}/{{ rtmp_streamer_inst_name }}/config.yml" properties: - checksum ## TODO: add record.sh if recording is enabled include_role: name: kubernetes/standalone/pod