mirror of
https://github.com/saltstack-formulas/template-formula.git
synced 2025-04-17 10:10:28 +00:00
Switch template.config to TOFS pattern
This commit is contained in:
parent
2dd659f20d
commit
784ce722ad
3 changed files with 12 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
3
template/files/default/example.tmpl
Normal file
3
template/files/default/example.tmpl
Normal file
|
@ -0,0 +1,3 @@
|
|||
# Managed by saltstack
|
||||
|
||||
This is an example file from SaltStack template-formula.
|
Loading…
Add table
Reference in a new issue