File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change 7
7
Files Switch (TOFS) pattern.
8
8
9
9
Params:
10
- * prefix: pillar prefix to custom ':files_switch'. Colons ':'
11
- are replaced by '/' to be used as directory prefix (<path_prefix>)
12
10
* files: ordered list of files to look for
13
11
* 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
15
13
use as selector switch of the directories under
16
14
"<path_prefix>/files"
17
15
* indent_witdh: indentation of the result value to conform to YAML
18
16
19
- Example:
17
+ Example (based on a `tplroot` of `xxx`) :
20
18
21
19
If we have a state:
22
20
23
21
Deploy configuration:
24
22
file.managed:
25
23
- 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
+ ) }}
28
30
- template: jinja
29
31
30
32
In a minion with id=theminion and os_family=RedHat, it's going to be
You can’t perform that action at this time.
0 commit comments