From 1e47bd571f4be2921d72e6f7f6a3a564412bf604 Mon Sep 17 00:00:00 2001 From: pierluca Date: Wed, 14 Jun 2017 09:14:45 +0200 Subject: [PATCH 1/2] Defaults are not ignored when pillar is set --- consul/map.jinja | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/consul/map.jinja b/consul/map.jinja index f4e9737..242d14a 100644 --- a/consul/map.jinja +++ b/consul/map.jinja @@ -1,5 +1,7 @@ {% import_yaml slspath+"/defaults.yaml" as defaults %} +{% set consul = salt['pillar.get']('consul', default=defaults.consul, merge=True) %} + {## Add any overrides based on CPU architecture. ##} {% set cpu_arch_map = salt['grains.filter_by']({ 'armv6l': { @@ -13,10 +15,9 @@ } } ,grain="cpuarch" - ,merge=salt['pillar.get']('consul')) + ,merge=consul) %} -{% do defaults.consul.update(cpu_arch_map) %} -{% set consul = salt['pillar.get']('consul', default=defaults.consul, merge=True) %} +{% do consul.update(cpu_arch_map) %} {% do consul.config.update({'retry_join': consul.config.retry_join or []}) %} From 31cd1b5137982ce37c85cdfcebcfb06453bf6470 Mon Sep 17 00:00:00 2001 From: pierluca Date: Mon, 19 Jun 2017 09:15:05 +0200 Subject: [PATCH 2/2] Applied review comments --- consul/map.jinja | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/consul/map.jinja b/consul/map.jinja index 242d14a..e5bbf72 100644 --- a/consul/map.jinja +++ b/consul/map.jinja @@ -3,7 +3,7 @@ {% set consul = salt['pillar.get']('consul', default=defaults.consul, merge=True) %} {## Add any overrides based on CPU architecture. ##} -{% set cpu_arch_map = salt['grains.filter_by']({ +{% set consul = salt['grains.filter_by']({ 'armv6l': { "arch": 'arm' }, @@ -18,6 +18,4 @@ ,merge=consul) %} -{% do consul.update(cpu_arch_map) %} - {% do consul.config.update({'retry_join': consul.config.retry_join or []}) %}