-
Notifications
You must be signed in to change notification settings - Fork 5.5k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
Jinja import cannot be referenced by any valid path from managed file deployed with salt-ssh #19564
Comments
I'm 95% sure this is a duplicate issue, but I can't find the original at the moment. Basically, we're not yet scraping the jinja to make sure we retrieve the files referenced there and sticking them in the state package, so they don't get scp'd to the target system. It's a known issue and something we still have to implement for salt-ssh. |
Ah, yes, that's the one! I remember now, we decided scraping or interpreting the jinja was too heavy, and so we decided to add it as a kwarg and opts entry: basically, define these extra files that need to be copies down in |
Because the problem is that minions can't request files from the master, so we have to inspect the state files before they ever make it down to the minion and make sure that all the files are present with the initial state pkg that we scp down, so these jinja references are difficult. |
I don't really understand how to use |
I expect he was referring to the master config ( |
That's strange because installing the |
Hrm, interesting. I think that's probably a result of the defaults generally being fine in salt-ssh. The salt-ssh package probably should be installing that config file, however. Anyway, you can just create the file if you want. |
This is really cumbersome because Salt Formulas have lots of such files and it's very annoying to have to maintain the list of such files... what about including by default all *.jinja files available in the configured file_roots ? This requires people to standardize on this extension for such jinja imports but at least it avoids the problem in 95% and people hit by the problem have an easy workaround. |
It does seem like a reasonable solution. We could even do something like have configurable list of file extensions to automatically sync down. The problems come when people have large file_roots with many files that go to a variety of minions. I mean, for a small setup, I could see just syncing the whole file_roots down to make things easy, but that doesn't scale. =\ |
Hi This also bit me. I'm confused about the usage of Can anyone give me a hint on this? I tracked this down and my first shot is that |
Right, that's to be expected. We can't actually inspect the state data for file refs until it has been rendered so that the jinja is gone. It's possible that extra-filerefs isn't working properly with gitfs, I'll have to find some time to investigate this. |
Thank you based basepi. |
+1 @slafs Nice distillation of the problem. I'm having the same issue with gitfs and extra filerefs. |
This issue still exists in 2016.3.1. Cloning formulas manually and adding to the file_roots list exists a work around. |
This issue ( |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue. |
Bump |
Thank you for updating this issue. It is no longer marked as stale. |
Bump |
Can documentation for extra_filerefs (the configuration option, not the command-line) be added somewhere, please? I can't see it in any of the master configuration docs, I've only learned how it's used by reading this issue. |
Saltfile (for salt-formula): salt-ssh:
extra_filerefs:
- salt://salt/map.jinja
- salt://salt/defaults.yaml
- salt://salt/osfamilymap.yaml
- salt://salt/osmap.yaml
- salt://salt/osfingermap.yaml
- salt://salt/libtofs.jinja sudo salt-ssh --saltfile /var/tmp/Saltfile ... Doesn't work anyway... |
@rafalkrupinski Is that on 3003? |
tried 3003.3 and 3002.7 --saltfile option shows in salt-ssh --help, but not in man/docs/tuts |
This is strange. The feature is known to be broken in 3003.x, but not in 3002: #61014 |
let me try recreating vagrant boxes, maybe I've missed some cache or sth |
IDK, doesn't work for me... |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Given the following managed file:
Containing any of the following import variations:
{% from 'macros/string.j2' import myFunction %}
{% from '/macros/string.j2' import myFunction %}
{% from 'salt://macros/string.j2' import myFunction %}
Running the following command will always throw
TemplateNotFound
:salt-ssh \* state.highstate
The text was updated successfully, but these errors were encountered: