-
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
salt-ssh jinja import_text breaks gitfs backend (also can't import from gitfs) #39881
Comments
Looks like i'm able to replicate this. Here is my test case:
And here is my gitfs:
It works when running against a normal minion but when using salt-ssh it breaks it and i see that template not found error. We will need to get this fixed up thanks. |
@Ch3LL Is there any progress on this? It's making salt-ssh unusable with gitfs backend and some months now since it was reported (indeed 2017.7 has come out since then). |
we do not currently have any progress of the issue as other issues are higher priority. Maybe my priority analysis of the issue was incorrect but I viewed this issue as an issue that would not bee seen by most users ( hence the P4 label) because it only did not work when including a ping @terminalmage might also have some ideas on this issue. Might be more in the salt-ssh realm, but do you see any easy solution here? |
@Ch3LL If I recall correctly, the same bug happens with Jinja's |
Looks like you are right. This does affect just a typical import. This seems to be affected by 2016.11 releases as well so not a regression.
ping @thatch45 any ideas here as to why we can't import gitfs file from a local file when using salt-ssh? |
I don't know my problem (https://groups.google.com/forum/#!topic/salt-users/JgE2IVB7U2I) is related to this, but for me it seems that jinja imports also don't work with gitfs if the mountpoint option is used. It looks like the import statement in the jinja does not respect the mountpoint option and therefore tries to import from the wrong directory. |
Got same issue. Looks like this problem due to dynamic file loading and Jinja filesystem loaded do not have correct context for include. in master: gitfs_remotes:
- https://github.com/saltstack-formulas/mysql-formula.git salt/top.sls: base:
'*':
- mysql Run Result is:
Salt output:
Modify top.sls base:
'*':
- mysql.server
- mysql Run
Salt:
Unfortunately, kludge with adding all required templates into top.sls is not work. |
I was able to find this issue: #9878 when re-analyzing this issue. So the current solution is using There is a feature request here: #19564 so once anyone here verifies this option works for them i'll close this issue in favor of this feature request so we can track there. |
Is there anything planned for the upcoming release regarding this problem (or #19564)? This issue makes it impossible to use 99.9% of all public formulas in combination with the gitfs mountpoint option (as they all use jinja imports), which make the mountpoint option essentially useless. |
This issue (extra_filerefs ignored on gitfs) still exists on salt 2017.7.2 (Nitrogen). I had managed several systems remotely from my master using salt-ssh earlier last year prior to moving the state and repos to gitfs. Now nothing works anymore. What's even more bizarre is that I swear I wasn't passing the extra_filerefs anywhere on the prior Salt release when I wasn't using gitfs, and it was working! Either way using gitfs doesn't work with exta_filerefs as of now. I can no longer remotely manage my systems because I import map.jinja at the top of my init.sls. |
Same behavior here: cannot import in Jinja. It works on gitfs if I am using salt and salt-call commands however the same state fails in salt-ssh.
|
It seems to be working for us. We call the exta_filerefs in the roster file. And point directly to our git location.
For example:
|
Nevermind. Formulas musta been cached when we added the repos local to verify local works vs. gitfs fails. Still having the same issue. |
Using salt-ssh:
When using
import_text
in jinja states, referencing files stored on a gitfs remote, the file cannot be found[1]. This works fine when executed via the minion, but fails with salt-ssh.This seems to have a cascading effect that other files stored on the gitfs, for subsequent IDs in the same state (possibly other states too) also become unavailable even for
salt://
references.For example,
file.managed
withsource: salt://
will fail to find the source file which is located on the gitfs backend. When not run subsequent to animport_text
, thesefile.managed
states work fine and pull the file from the gitfs just fine. It's as if theimport_text
breaks something.In addition to this, if the
import_text
file is made available on a localfile_root
so that this loads fine, the subsequently executed IDs usingfile.managed
andsource: salt://
still fail to find the gitfs source files. Again, it appears as if once theimport_text
has happened, the gitfs backend is gone and the only place being checked is the localfile_root
[2][1]
[2]
Example state:
The text was updated successfully, but these errors were encountered: