summaryrefslogtreecommitdiff
path: root/roles/streaming/recorder/tasks/main.yml
blob: f40657392a424d694568d9635caecf03f67cd7dd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
---
- name: prepare recorder storage volume
  when: recorder_storage is defined
  vars:
    storage_volume: "{{ recorder_storage | combine({'dest': recorder_base_path}) }}"
  include_role:
    name: "storage/{{ recorder_storage.type }}/volume"

- name: create recorder instance directory
  file:
    path: "{{ recorder_base_path }}/{{ recorder_inst_name }}"
    state: directory

- name: generate recorder config
  copy:
    content: "{{ recorder_config | combine({'record': {'segment_time': recorder_segment_time, 'clocktime_offset': recorder_segment_clocktime_offset, 'target': '/srv/recordings'}}) | to_nice_yaml }}\n"
    dest: "{{ recorder_base_path }}/{{ recorder_inst_name }}/config.yml"

- name: create recording directory
  file:
    path: "{{ recorder_base_path }}/{{ recorder_inst_name }}/recordings"
    state: directory
    owner: app
    group: app

- name: install pod manifest
  vars:
    kubernetes_standalone_pod:
      name: "recorder-{{ recorder_inst_name }}"
      spec: "{{ lookup('template', 'pod-spec.yml.j2') }}"
      config_hash_items:
      - path: "{{ recorder_base_path }}/{{ recorder_inst_name }}/config.yml"
        properties:
        - checksum
  include_role:
    name: kubernetes/standalone/pod