summaryrefslogtreecommitdiffstats
path: root/salt/profile/matterbridge/init.sls
diff options
context:
space:
mode:
Diffstat (limited to 'salt/profile/matterbridge/init.sls')
-rw-r--r--salt/profile/matterbridge/init.sls45
1 files changed, 45 insertions, 0 deletions
diff --git a/salt/profile/matterbridge/init.sls b/salt/profile/matterbridge/init.sls
new file mode 100644
index 0000000..eee6df2
--- /dev/null
+++ b/salt/profile/matterbridge/init.sls
@@ -0,0 +1,45 @@
+{%- set mypillar = 'profile:matterbridge' -%}
+{%- set instances = salt['pillar.get'](mypillar ~ ':instances') or [] -%}
+
+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 }}
+
+matterbridge_{{ instance }}_service:
+ service.running:
+ - name: matterbridge@{{ instance }}.service
+ - enable: True
+{%- endfor %}
+{%- endif %}
+
+matterbridge_cleanup_timer:
+ service.running:
+ - name: matterbridge-cleanup.timer
+ - enable: True