This repository has been archived by the owner on Jun 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
/
install_janus.yml
56 lines (49 loc) · 1.77 KB
/
install_janus.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
---
- name: install apt_key dependency
apt:
name: gnupg
- name: add archive apt repository key
apt_key:
url: https://ftp-master.debian.org/keys/archive-key-{{ ansible_distribution_major_version }}.asc
state: present
when: ustreamer_is_os_raspbian or ustreamer_is_os_debian
- name: enable Janus apt suite
apt_repository:
repo: deb http://deb.debian.org/debian {{ ustreamer_janus_apt_suite }} main
state: present
when: ustreamer_is_os_raspbian or ustreamer_is_os_debian
- name: install Janus package and C header files
apt:
name:
- janus
- janus-dev
default_release: "{{ ustreamer_janus_apt_suite }}"
# Allow Janus C header files to be included when compiling third-party plugins.
# Issue: https://github.com/tiny-pilot/ansible-role-tinypilot/issues/192
- name: patch Janus plugin.h file to successfully include refcount.h file
lineinfile:
path: /usr/include/janus/plugins/plugin.h
regexp: '^#include "refcount\.h"$'
line: '#include "../refcount.h"'
- name: create Janus config files
template:
src: "{{ item }}.j2"
dest: "{{ ustreamer_janus_configs_dir }}/{{ item }}"
owner: root
group: root
mode: '0644'
loop:
- janus.jcfg
- janus.transport.websockets.jcfg
notify:
- restart Janus
# To determine the correct path for Janus plugins, transports, and loggers we
# need to determine the base multi-arch library path for the target machine.
# https://wiki.osdev.org/Target_Triplet
- name: get multi-arch target triplet (i.e., machine-vendor-operatingsystem)
shell: gcc -dumpmachine
register: ustreamer_multiarch_target_result
changed_when: false
- name: determine Janus plugins directory
set_fact:
ustreamer_janus_plugins_dir: /usr/lib/{{ ustreamer_multiarch_target_result.stdout }}/janus/plugins