From 63060876729e81e27b71e5eced59b9b64a7a7aae Mon Sep 17 00:00:00 2001 From: Guillaume Thouvenin Date: Mon, 28 Nov 2016 12:04:11 +0100 Subject: [PATCH] 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. --- grafana/client.sls | 2 +- grafana/collector.sls | 2 +- grafana/server.sls | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/grafana/client.sls b/grafana/client.sls index 804fa12..ec36ef7 100644 --- a/grafana/client.sls +++ b/grafana/client.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: diff --git a/grafana/collector.sls b/grafana/collector.sls index b1f76b1..93393f3 100644 --- a/grafana/collector.sls +++ b/grafana/collector.sls @@ -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: diff --git a/grafana/server.sls b/grafana/server.sls index c3fc7ed..7e5445e 100644 --- a/grafana/server.sls +++ b/grafana/server.sls @@ -1,5 +1,5 @@ {%- from "grafana/map.jinja" import server with context %} -{%- if server.enabled %} +{%- if server.get('enabled', False) %} grafana_packages: pkg.installed: