Skip to content

Commit

Permalink
fix(tofs): update comments in files_switch macro for new method
Browse files Browse the repository at this point in the history
  • Loading branch information
myii committed Feb 27, 2019
1 parent 923b459 commit 3fa3640
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions template/macros.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,26 @@
Files Switch (TOFS) pattern.
Params:
* prefix: pillar prefix to custom ':files_switch'. Colons ':'
are replaced by '/' to be used as directory prefix (<path_prefix>)
* files: ordered list of files to look for
* default_files_switch: if there's no pillar
'<prefix>:files_switch' this is the ordered list of grains to
'<tplroot>:tofs:files_switch' this is the ordered list of grains to
use as selector switch of the directories under
"<path_prefix>/files"
* indent_witdh: indentation of the result value to conform to YAML
Example:
Example (based on a `tplroot` of `xxx`):
If we have a state:
Deploy configuration:
file.managed:
- name: /etc/yyy/zzz.conf
- source: {{ files_switch('xxx', ['/etc/yyy/zzz.conf',
'/etc/yyy/zzz.conf.jinja']) }}
- source: {{ files_switch(
salt['config.get'](
tplroot ~ ':tofs:files:Deploy configuration',
['/etc/yyy/zzz.conf', '/etc/yyy/zzz.conf.jinja']
)
) }}
- template: jinja
In a minion with id=theminion and os_family=RedHat, it's going to be
Expand Down

0 comments on commit 3fa3640

Please sign in to comment.