Skip to content

Commit 3fa3640

Browse files
committed
fix(tofs): update comments in files_switch macro for new method
1 parent 923b459 commit 3fa3640

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

template/macros.jinja

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,26 @@
77
Files Switch (TOFS) pattern.
88
99
Params:
10-
* prefix: pillar prefix to custom ':files_switch'. Colons ':'
11-
are replaced by '/' to be used as directory prefix (<path_prefix>)
1210
* files: ordered list of files to look for
1311
* default_files_switch: if there's no pillar
14-
'<prefix>:files_switch' this is the ordered list of grains to
12+
'<tplroot>:tofs:files_switch' this is the ordered list of grains to
1513
use as selector switch of the directories under
1614
"<path_prefix>/files"
1715
* indent_witdh: indentation of the result value to conform to YAML
1816
19-
Example:
17+
Example (based on a `tplroot` of `xxx`):
2018
2119
If we have a state:
2220
2321
Deploy configuration:
2422
file.managed:
2523
- name: /etc/yyy/zzz.conf
26-
- source: {{ files_switch('xxx', ['/etc/yyy/zzz.conf',
27-
'/etc/yyy/zzz.conf.jinja']) }}
24+
- source: {{ files_switch(
25+
salt['config.get'](
26+
tplroot ~ ':tofs:files:Deploy configuration',
27+
['/etc/yyy/zzz.conf', '/etc/yyy/zzz.conf.jinja']
28+
)
29+
) }}
2830
- template: jinja
2931
3032
In a minion with id=theminion and os_family=RedHat, it's going to be

0 commit comments

Comments
 (0)