From 650854fa2730c6f61a3f7117d7271907e4a2a587 Mon Sep 17 00:00:00 2001 From: Georg Pfuetzenreuter Date: Tue, 7 Feb 2023 22:20:39 +0100 Subject: Refactor matterbridge profile - reduce pillar calls - no longer define possible configuration options, apply settings from pillar 1:1 Signed-off-by: Georg Pfuetzenreuter --- salt/profile/matterbridge/init.sls | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'salt/profile/matterbridge/init.sls') diff --git a/salt/profile/matterbridge/init.sls b/salt/profile/matterbridge/init.sls index eee6df2..1e0cd51 100644 --- a/salt/profile/matterbridge/init.sls +++ b/salt/profile/matterbridge/init.sls @@ -1,5 +1,5 @@ -{%- set mypillar = 'profile:matterbridge' -%} -{%- set instances = salt['pillar.get'](mypillar ~ ':instances') or [] -%} +{%- set mypillar = salt['pillar.get']('profile:matterbridge') -%} +{%- set instances = mypillar['instances'] | default([]) -%} matterbridge_packages: pkg.installed: @@ -31,7 +31,12 @@ matterbridge_files: - /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 -- cgit v1.2.3