Use get function to check if a role is enabled

This patch uses the function get with False by default. This is to allow
to call a state even if the node is not classified.
pull/14/head
Guillaume Thouvenin 6 years ago
parent a927d2162c
commit 6306087672
  1. 2
      grafana/client.sls
  2. 2
      grafana/collector.sls
  3. 2
      grafana/server.sls

@ -1,5 +1,5 @@
{%- from "grafana/map.jinja" import client with context %}
{%- if client.enabled %}
{%- if client.get('enabled', False) %}
/etc/salt/minion.d/_grafana.conf:
file.managed:

@ -1,5 +1,5 @@
{%- from "grafana/map.jinja" import collector with context %}
{%- if collector.enabled %}
{%- if collector.get('enabled', False) %}
grafana_grains_dir:
file.directory:

@ -1,5 +1,5 @@
{%- from "grafana/map.jinja" import server with context %}
{%- if server.enabled %}
{%- if server.get('enabled', False) %}
grafana_packages:
pkg.installed:

Loading…
Cancel
Save