From 5e9df004d97fde7adb98550f0dcf8f2807d60b67 Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Mon, 25 Feb 2019 13:49:08 +0000 Subject: [PATCH] fix(tofs): use `tpldir` derivative `topdir` for pillar (config) paths * With nested `.sls` files, `tpldir` respectively resolves to: - `template/` * Without this fix, only the default value provided is ever used, respectively: - `['example.tmpl', 'example.tmpl.jinja']` * Follows-on from https://github.com/saltstack-formulas/systemd-formula/pull/22 --- template/config.sls | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/template/config.sls b/template/config.sls index cb23b8a8..13ad6686 100644 --- a/template/config.sls +++ b/template/config.sls @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- # vim: ft=sls +{%- set topdir = tpldir.split('/')[0] %} {%- from tpldir ~ "/map.jinja" import template with context %} {%- from tpldir ~ "/macros.jinja" import files_switch with context %} @@ -12,7 +13,7 @@ template-config: - name: {{ template.config }} - source: {{ files_switch( salt['config.get']( - tpldir ~ ':tofs:files:template-config', + topdir ~ ':tofs:files:template-config', ['example.tmpl', 'example.tmpl.jinja'] ) ) }}