From 002fad5f2706cfc609fb49dd56a75e6dd12dd5da Mon Sep 17 00:00:00 2001 From: Georg Pfuetzenreuter Date: Sun, 29 Jan 2023 14:03:46 +0100 Subject: [PATCH] salt.minion: allow minions without roles If-clause to check for Syndic roles caused regression on minions without any assigned roles. Signed-off-by: Georg Pfuetzenreuter --- salt/profile/salt/minion.sls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/profile/salt/minion.sls b/salt/profile/salt/minion.sls index d9265c4..12bef1d 100644 --- a/salt/profile/salt/minion.sls +++ b/salt/profile/salt/minion.sls @@ -1,5 +1,5 @@ {%- set netbox_pillar = salt['pillar.get']('netbox') -%} -{%- if 'custom_fields' in netbox_pillar and 'salt.syndic' in netbox_pillar['custom_fields']['salt_roles'] -%} +{%- if 'custom_fields' in netbox_pillar and netbox_pillar['custom_fields']['salt_roles'] is not none and 'salt.syndic' in netbox_pillar['custom_fields']['salt_roles'] -%} {%- set master = salt['pillar.get']('salt:master:syndic_master') -%} {%- elif 'config_context' in netbox_pillar -%} {%- set master = netbox_pillar['config_context']['salt_master'] -%}