Skip to content

Commit b778901

Browse files
committed
fix(tofs): prepend the config-based source_files to the default
* saltstack-formulas/nginx-formula#247 (comment) - The main issue is that the `nginx-formula` has dynamic values being used by as the default `source_files` -- there is no way to provide this from the pillar/config in a sensible fashion - Prepending to this default (rather than overriding it) resolves this problem entirely, without adding excessive entries to the `source` * Closes saltstack-formulas#151
1 parent 57d0b85 commit b778901

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

template/libtofs.jinja

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
1111
Params:
1212
* source_files: ordered list of files to look for
13-
* lookup: key under '<tplroot>:tofs:source_files' to override
13+
* lookup: key under '<tplroot>:tofs:source_files' to prepend to the
1414
list of source files
1515
* default_files_switch: if there's no config (e.g. pillar)
1616
'<tplroot>:tofs:files_switch' this is the ordered list of grains to
@@ -55,14 +55,13 @@
5555
tplroot ~ ':tofs:files_switch',
5656
default_files_switch
5757
) %}
58-
{#- Lookup source_files (v2), files (v1), or fallback to source_files parameter #}
58+
{#- Lookup source_files (v2), files (v1), or fallback to an empty list #}
5959
{%- set src_files = salt['config.get'](
6060
tplroot ~ ':tofs:source_files:' ~ lookup,
61-
salt['config.get'](
62-
tplroot ~ ':tofs:files:' ~ lookup,
63-
source_files
64-
)
61+
salt['config.get'](tplroot ~ ':tofs:files:' ~ lookup, [])
6562
) %}
63+
{#- Append the default source_files #}
64+
{%- set src_files = src_files + source_files %}
6665
{#- Only add to [''] when supporting older TOFS implementations #}
6766
{%- set path_prefix_exts = [''] %}
6867
{%- if v1_path_prefix != '' %}

0 commit comments

Comments
 (0)