Switch template.config to TOFS pattern

This commit is contained in:
Daniel Dehennin 2019-02-06 16:12:02 +01:00
parent 2dd659f20d
commit 784ce722ad
3 changed files with 12 additions and 1 deletions

View file

@ -1,3 +1,10 @@
template:
lookup:
master: template-master
# The files_switch key serves as a selector for alternative
# directories under the formula files directory. See TOFS pattern
# doc for more info.
files_switch:
- id
- os_familly

View file

@ -2,11 +2,12 @@
# vim: ft=sls
{% from "template/map.jinja" import template with context %}
{% from "template/macros.jinja" import files_switch with context %}
template-config:
file.managed:
- name: {{ template.config }}
- source: salt://template/files/example.tmpl
- source: {{ files_switch('template', ['example.tmpl'] }}
- mode: 644
- user: root
- group: root

View file

@ -0,0 +1,3 @@
# Managed by saltstack
This is an example file from SaltStack template-formula.