[BUG] Relative path not working on master-minion setup with windows minion #61040
Closed
1 of 6 tasks
Labels
Bug
broken, incorrect, or confusing behavior
doc-correction
docu page has an error or deadlink
doc-ex-missing
no examples exist in docs
State-Compiler
Sulfur v3006.0
release code name and version
Windows
Milestone
Description
When using relative path (eg.:
{% from './map.jinja' import packages with context %}
) in a formula, a windows minion will not cache the file speficied in the relative path (I can't find that file insideC:\salt\var\cache\salt\minion\files\base\formula-name
).Setup
Steps to Reproduce the behavior
We have found this bug using the
package
formula with thechocolatey
state on a windows minion.We had this pillar:
When we run the command
salt skyros.pc.itc.it state.test packages.chocolatey
, we get the error:and in the cache folder on the target (
C:\salt\var\cache\salt\minion\files\base\packages
) the only file ischocolately.sls
without anymap.jinja
.We tried with different version of salt-minion, with different windows version (win10, win server 2016/2019) and with two different salt-master (same version of salt-master).
When I run
salt skyros.pc.itc.it state.test packages
in the cache folder on the target machine I have more files (for example themap.jinja
) but not all files (thedefault.yaml
is missing). In fact I get multiple errors regarding thedefault.yaml
file, like this:Additional tests
With every test it's important to have the cache folder on the minion (
C:\salt\var\cache\salt\minion\files\base
) empty. We usesalt skyros.pc.itc.it saltutil.clear_cache
.We tried without chocolatey, so using directly winrepo. My pillar now is:
but the problem persist.
We then did other tests to understand if the bug was only related to that formula.
We made a simple formula called "winpackages":
init.sls
:map.jinja
:pillar.sls
and this is not working, always giving me
./map.jinja not found
.Then we modify the init.sls like this:
init.sls
:and this is working.
Our theory is: salt minion is searching
./map.jinja
not inside the formula folder, but on the parent folder (C:\salt\var\cache\salt\minion\files\base
).BUT, we did another test:
winpackages/map.jinja
)C:\salt\var\cache\salt\minion\files\base\winpackages
we have bothmap.jinja
andinit.sls
)./map.jinja
) is now working.So our theory is wrong: the salt-minion is not searching in the parent formula (at least when the formula's files are cached).
Expected behavior
Salt minion should understand the relative path specified in the formula and it should cache those formula's file in the minion.
Versions Report
Salt master:
Salt minion:
Additional context
We thought it was a bug of the
package
formula, in particular with thechocolatey
state so we opened an issue with the same details here: saltstack-formulas/packages-formula#79 .The text was updated successfully, but these errors were encountered: