blob: 1e0cd5122df4b411f3390ae33345c8844672d03c (
plain)
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
|
{%- set mypillar = salt['pillar.get']('profile:matterbridge') -%}
{%- set instances = mypillar['instances'] | default([]) -%}
matterbridge_packages:
pkg.installed:
- pkgs:
- matterbridge
matterbridge_directory:
file.directory:
- user: root
- group: matterbridge
- clean: True
- require:
- pkg: matterbridge_packages
{%- if instances | length > 0 %}
- file: matterbridge_files
{%- endif %}
- names:
- /etc/matterbridge
{%- if instances | length > 0 %}
matterbridge_files:
file.managed:
- user: root
- mode: '0644'
- template: jinja
- source: salt:///{{ slspath }}/files/etc/matterbridge/matterbridge.toml.j2
- names:
{%- for instance in instances %}
- /etc/matterbridge/{{ instance }}.toml:
- context:
instance: {{ instance }}
general: {{ instances[instance]['general'] | default({}) }}
accounts: {{ instances[instance]['accounts'] }}
gateways: {{ instances[instance]['gateways'] }}
{%- endfor %}
{%- for instance in instances %}
matterbridge_{{ instance }}_service:
service.running:
- name: matterbridge@{{ instance }}.service
- enable: True
{%- endfor %}
{%- endif %}
matterbridge_cleanup_timer:
service.running:
- name: matterbridge-cleanup.timer
- enable: True
|