site_rtmp_tasks.yml 837 Bytes
Newer Older
1
2
- debug: var=rtmp

hatsch's avatar
hatsch committed
3
4
5
6
7
8
9
10
11
12
- name: "Create HLS directory for {{ rtmp.key }}"
  file:
    state: directory
    path: "/var/www/{{ site.key }}/{{ item }}/{{ rtmp.key }}"
    owner: www-data
    group: www-data
  with_items:
    - hls
    - player

13
14
15
16
17
18
19
20
21
22
23
24
25
- name: "Template rtmp application {{ rtmp.key }} for {{ site.key }}"
  template:
    src: rtmp.j2
    dest: "/etc/nginx/rtmp-available/{{ site.key }}_{{ rtmp.key }}"
  notify:
    - reload nginx     
    
- name: "Enable rtmp application {{ rtmp.key }} for {{ site.key }} "
  file:
    src: "/etc/nginx/rtmp-available/{{ site.key }}_{{ rtmp.key }}"
    dest: "/etc/nginx/rtmp-enabled/{{ site.key }}_{{ rtmp.key }}"        
    state: link
  notify:
hatsch's avatar
hatsch committed
26
27
28
29
30
31
    - reload nginx

- name: "Add index.html"
  template:
    src: index.html.j2
    dest: "/var/www/{{ site.key }}/player/{{ rtmp.key }}/index.html"