Skip to content

Commit

Permalink
fix(tofs): use tpldir derivative topdir for pillar (config) paths
Browse files Browse the repository at this point in the history
* With nested `.sls` files, `tpldir` respectively resolves to:
  - `template/<subdir>`
* Without this fix, only the default value provided is ever used, respectively:
  - `['example.tmpl', 'example.tmpl.jinja']`
* Follows-on from saltstack-formulas/systemd-formula#22
  • Loading branch information
myii committed Feb 25, 2019
1 parent 0fabb21 commit 5e9df00
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion template/config.sls
Original file line number Diff line number Diff line change
@@ -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 %}
Expand All @@ -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']
)
) }}
Expand Down

0 comments on commit 5e9df00

Please sign in to comment.