forked from saltstack-formulas/template-formula
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(tofs): implement backwards-compatible TOFSv2 for configurability
* As discussed between comments: - https://freenode.logbot.info/saltstack-formulas/20190214#c1995273 - https://freenode.logbot.info/saltstack-formulas/20190214#c1995487 * Squashed original PR with these commits present: - Improve TOFS implementation for increased configurability - Improve TOFS to allow custom files selection as well - Simplify `files_switch` macro to use only one loop - Make TOFS pattern fully-portable by using `tpldir` - Update `pillar.example` with current scheme for TOFS - Update `pillar.example` with the proposed scheme for TOFS - Fix bug where duplicate default lines are produced by the loop - feat(tofs): fix to work with old & new pillars and `tpldir` context * Already tested and applied over existing TOFS in `systemd-formula`: - saltstack-formulas/systemd-formula#17
- Loading branch information
Showing
4 changed files
with
56 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,22 @@ | ||
# -*- coding: utf-8 -*- | ||
# vim: ft=sls | ||
|
||
{% from "template/map.jinja" import template with context %} | ||
{% from "template/macros.jinja" import files_switch with context %} | ||
{%- from "template/map.jinja" import template with context %} | ||
{%- from "template/macros.jinja" import files_switch with context %} | ||
include: | ||
- template.install | ||
template-config: | ||
file.managed: | ||
- name: {{ template.config }} | ||
- source: {{ files_switch('template', ['example.tmpl']) }} | ||
- source: {{ files_switch( | ||
salt['config.get']( | ||
tpldir ~ ':tofs:files:template-config', | ||
['example.tmpl', 'example.tmpl.jinja'] | ||
) | ||
) }} | ||
- mode: 644 | ||
- user: root | ||
- group: root | ||
- template: jinja |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
# Managed by saltstack | ||
######################################################################## | ||
# File managed by Salt at <{{ source }}>. | ||
# Your changes will be overwritten. | ||
######################################################################## | ||
|
||
This is an example file from SaltStack template-formula. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
######################################################################## | ||
# File managed by Salt at <{{ source }}>. | ||
# Your changes will be overwritten. | ||
######################################################################## | ||
|
||
This is another example file from SaltStack template-formula. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters