From 3fa36402b79daf56e85def96dc4170f8f99c8596 Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Wed, 27 Feb 2019 03:31:39 +0000 Subject: [PATCH] fix(tofs): update comments in `files_switch` macro for new method --- template/macros.jinja | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/template/macros.jinja b/template/macros.jinja index 0863cf8f..8fb5c469 100644 --- a/template/macros.jinja +++ b/template/macros.jinja @@ -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 () * files: ordered list of files to look for * default_files_switch: if there's no pillar - ':files_switch' this is the ordered list of grains to + ':tofs:files_switch' this is the ordered list of grains to use as selector switch of the directories under "/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