From 08d10376abb17afbc86184ed253e079473ba1405 Mon Sep 17 00:00:00 2001 From: carpenti Date: Wed, 5 Oct 2016 21:14:00 +0200 Subject: [PATCH] implementing retro-compatible behavior Using the old salt.engines pillar and merging it with the new salt.[master|minion].engines pillar. This way, it doesn't break previous behavior and permits to define common engines on master and minion. In the merge, the salt.[master|minion].engines pillar takes precedence if conflict as it's the more specific pillar. --- salt/files/master.d/engine.conf | 3 ++- salt/files/minion.d/engine.conf | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/salt/files/master.d/engine.conf b/salt/files/master.d/engine.conf index 5e7089d..746cdbe 100644 --- a/salt/files/master.d/engine.conf +++ b/salt/files/master.d/engine.conf @@ -1,7 +1,8 @@ # # This file is managed by Salt! Do not edit by hand! # -{%- set engines = salt['pillar.get']('salt:master:engines') -%} +{%- set engines = salt['pillar.get']('salt:engines') -%} +{%- set engines = salt['pillar.get']('salt:master:engines', default=engines, merge=True) -%} {%- if engines %} engines: {{ engines | yaml(False) | indent(2) }} diff --git a/salt/files/minion.d/engine.conf b/salt/files/minion.d/engine.conf index 17773e5..658f0e0 100644 --- a/salt/files/minion.d/engine.conf +++ b/salt/files/minion.d/engine.conf @@ -1,7 +1,8 @@ # # This file is managed by Salt! Do not edit by hand! # -{%- set engines = salt['pillar.get']('salt:minion:engines') -%} +{%- set engines = salt['pillar.get']('salt:engines') -%} +{%- set engines = salt['pillar.get']('salt:minion:engines', default=engines, merge=True) -%} {%- if engines %} engines: {{ engines | yaml(False) | indent(2) }}