-
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
forumla's map.jinja not found in jinja-template-files on salt-ssh #31531
Comments
@sgeisbacher, thanks for reporting. |
@jfindlay can I work on this issue ? |
The know workaround is using extra_filerefs. The salt-ssh code doesn't pick up files that aren't referenced by include or source. The import doesn't count. I have tried a system of having a state to source the map.jinja in cases of salt-ssh, but it proved to be more work than using the extra_filerefs method. See #9878 for history.
|
@Ismail-AlJubbah Certainly! |
Another possible workaroung is to use the import statement in the init.sls and then pass the jinjatest variable as context to the file.managed state. This is also more clean IMO. |
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. |
Any update? |
Thank you for updating this issue. It is no longer marked as stale. |
If using the context does not work for you, I have another workaround. |
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. |
I made an ugly patch that seemingly fixes this issue by packing the whole diff --git a/salt/fileclient.py b/salt/fileclient.py
index d606bea99e..64ae1b0a63 100644
--- a/salt/fileclient.py
+++ b/salt/fileclient.py
@@ -238,7 +238,7 @@ class Client(object):
# the target directory and caching them
for fn_ in self.file_list(saltenv):
fn_ = salt.utils.data.decode(fn_)
- if fn_.strip() and fn_.startswith(path):
+ if fn_.strip() and (fn_.startswith(path) or path == '/'):
if salt.utils.stringutils.check_include_exclude(
fn_, include_pat, exclude_pat
): To activate it add ssh_minion_opts:
extra_filerefs: salt:// |
Interestingly, I have it working for salt-ssh I do not use Regards. |
I did more tests with 6 machines with different versions of Each machine has the following setup:
|
I ran a test with
|
Retrying my tests, I have a strange behavior:
|
When I change Weird. |
I have the exact same caching issue with |
Hello, #61895 fixes my issues with either |
Is |
I found a workaround by explicitly caching the wanted files as I tried with collectd formula. |
Expected Behavior
the forumla's file-generation by jinja-template should load map.jinja also on salt-ssh.
this formula works with salt minion state.highstate like a charm, but not with salt-ssh minion state.highstate
Actual Behavior
when performing a state.highstate via salt-ssh i get the following error-msg: (see bottom)
Steps to Reproduce Issue
{% from ... import ... %}
Versions Report
Relevant Logs, Configs, or States
here is the simple-test-formula:
salt-jinjatest.zip
The text was updated successfully, but these errors were encountered: