-
-
Notifications
You must be signed in to change notification settings - Fork 255
/
main.yml
100 lines (84 loc) · 2.73 KB
/
main.yml
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
---
- name: check that the H264 variables are in a consistent state
fail:
msg: >-
The H264 variables are in an inconsistent state. You must set the
ustreamer_h264_sink variable in order to set other H264 variables.
when: >-
ustreamer_h264_sink == None
and (ustreamer_h264_sink_mode != None
or ustreamer_h264_sink_rm != None
or ustreamer_h264_bitrate != None)
- name: determine whether to install Janus
set_fact:
ustreamer_install_janus: "{{ ustreamer_h264_sink != None }}"
- name: decide whether to support audio streaming
set_fact:
# Audio streaming requires Janus because MJPEG can't carry audio.
ustreamer_enable_audio_streaming: "{{ ustreamer_install_janus }}"
- name: install Janus
include_tasks: install_janus.yml
when: ustreamer_install_janus
- name: install uStreamer Debian package
apt:
deb: "{{ ustreamer_debian_package_path }}"
- name: fix uStreamer folder permissions
file:
path: "{{ ustreamer_dir }}"
state: directory
owner: "{{ ustreamer_user }}"
group: "{{ ustreamer_group }}"
recurse: yes
tags:
- molecule-idempotence-notest
- name: install uStreamer as a service
template:
src: ustreamer.systemd.j2
dest: /lib/systemd/system/ustreamer.service
owner: root
group: root
mode: "0644"
notify:
- reload systemd config
- restart uStreamer
- restart Janus
- name: enable systemd uStreamer service file
systemd:
name: ustreamer
enabled: yes
- name: create uStreamer Janus plugin config
template:
src: janus.plugin.ustreamer.jcfg.j2
dest: "{{ ustreamer_janus_configs_dir }}/janus.plugin.ustreamer.jcfg"
notify:
- restart Janus
when: ustreamer_install_janus
- name: check for a boot config file
stat:
path: /boot/config.txt
register: boot_config_result
- name: save whether boot config file exists
set_fact:
boot_config_exists: "{{ boot_config_result.stat.exists }}"
- name: check whether this machine has a uStreamer settings file
stat:
path: "{{ ustreamer_settings_file }}"
register: ustreamer_settings_file_result
- name: read saved settings
import_tasks: check_saved_settings.yml
when: ustreamer_settings_file_result.stat.exists | bool
- name: configure TC358743 HDMI capture chip
import_tasks: provision_tc358743.yml
when: ustreamer_capture_device == 'tc358743'
- name: uninstall TC358743 settings if they're not in use
import_tasks: remove_tc358743.yml
when: ustreamer_capture_device != 'tc358743'
- name: save uStreamer settings file
template:
src: config.yml.j2
dest: "{{ ustreamer_settings_file }}"
owner: "{{ ustreamer_user }}"
group: "{{ ustreamer_group }}"
mode: "0644"
- name: install uStreamer launcher
import_tasks: install_launcher.yml