salt.minion: allow minions without roles
All checks were successful
ci/lysergic/push/pipeline Pipeline was successful

If-clause to check for Syndic roles caused regression on minions without
any assigned roles.

Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
This commit is contained in:
Georg Pfuetzenreuter 2023-01-29 14:03:46 +01:00
parent bd7fe25eb0
commit 002fad5f27
Signed by: Georg
GPG Key ID: 1ED2F138E7E6FF57

View File

@ -1,5 +1,5 @@
{%- set netbox_pillar = salt['pillar.get']('netbox') -%} {%- 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') -%} {%- set master = salt['pillar.get']('salt:master:syndic_master') -%}
{%- elif 'config_context' in netbox_pillar -%} {%- elif 'config_context' in netbox_pillar -%}
{%- set master = netbox_pillar['config_context']['salt_master'] -%} {%- set master = netbox_pillar['config_context']['salt_master'] -%}