summaryrefslogtreecommitdiffstats
path: root/salt/profile/matterbridge/files/etc/matterbridge/matterbridge.toml.j2
blob: 11204f366853460d9ea0958e79d146eee38983fe (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
{%- set header = salt['pillar.get']('managed_header_pound') -%}
{%- set myfqdn = salt['grains.get']('fqdn') -%}
{%- set mypillar = 'profile:matterbridge:instances:' ~ instance ~ ':' -%}
{%- set myaccounts = mypillar ~ 'accounts' -%}
{%- set mygateways = mypillar ~ 'gateways' -%}
{%- set generalopts = ['RemoteNickFormat', 'IgnoreFailureOnStart', 'MessageSplit', 'MediaDownloadSize', 'MediaDownloadPath', 'MediaServerDownload', 'LogFile'] -%}
{%- set accountopts = ['Nick', 'NickServNick', 'NickServPassword', 'Server', 'UseTLS', 'UseSASL', 'Label', 'Charset', 'IgnoreNicks', 'RunCommands', 'UseRelayMsg', 'RemoteNickFormat'] -%}
{{ header }}

[general]
{% for option in generalopts %}
{%- if salt['pillar.get'](mypillar ~ option, None) != None %}
{{ option }}="{{ salt['pillar.get'](mypillar ~ option) }}"
{%- endif -%}
{%- endfor -%}

{% for account, config in salt['pillar.get'](myaccounts).items() %}
[{{ config['protocol'] }}.{{ account }}]
{%- for option in accountopts %}
{%- if salt['pillar.get'](myaccounts ~ ':' ~ account ~ ':' ~ option, None) != None %}
{{ option }}="{{ config[option] }}"
{%- endif -%}
{% endfor %}
{% endfor -%}

{% for gateway, config in salt['pillar.get'](mygateways).items() %}
[[gateway]]
name="{{ gateway }}"
enable=true
{% for account, channel in config.items() %}
  [[gateway.inout]]
  account="{{ account }}"
  channel="{{ channel }}"
{% endfor %}
{%- endfor -%}