-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
file.recurse with multiple sources unexpected behavior when dynamic sources are provided. #54102
Comments
I think this may not be a bug. According to the documentation https://docs.saltstack.com/en/latest/ref/states/all/salt.states.file.html#salt.states.file.recurse is supposed to receive a single source (not a list of source) . I see some ticket with multiple sources though (e.g, #9304) |
@kyanh-vX7HLAHZLPsUxeHD Multiple sources are supported and the code should pick the first one from the list that exists. If you remove the if statement with the grains does it work as expected and the first one in the list that exists is picked? |
@garethgreenaway Yes it works well when I remove the |
Yes, it does, as seen below
|
I've found that the use of
Now remove them both:
This code works perfectly. I think I totally misunderstood how whitespace control works. |
Description of Issue
When multiple sources are provided in
file.recurse
, and if one of the sources may be excluded by some grains data,file.recurse
picks up the last source instead of the first source.Setup
bootstrap-salt.sh git develop
; note: this problem also happens with salt-2018 the stable version).minion grains
/srv/salt/base/init.sls
/srv/salt/xfiles/
Steps to Reproduce Issue
Step 1: With dynamic list of sources
Now execute highstate on the minion, and see the results
The result is not as expected
Step 2: Without dynamic list of sources:
Now uncomment the dynamic block
Apply the new state and see the expected resulted file
The resulted file is execpted:
Versions Report
The text was updated successfully, but these errors were encountered: