Giter Site home page Giter Site logo

Comments (6)

myii avatar myii commented on August 22, 2024

Thanks for the detailed report, @thomas-thorburn-connect. This is a known problem encountered with salt-ssh. The solution is to avoid importing directly in templates and to pass data via. context instead (from the file.managed state). A couple of recent formulas that were fixed are shown under the subtasks of this user story:

So follow through to either of the PRs that are mentioned will show how this needs to be tackled here. This is probably the easier of the two to adapt for this formula:

The problem in this formula is that there are quite a few templates that will need to be adapted. @thomas-thorburn-connect May I suggest trying to adapt the template you're using locally, to confirm this fix works for you? We can then discuss how to proceed with the rest of the templates.

from redis-formula.

infoveinx avatar infoveinx commented on August 22, 2024

Hi. So with up to at least 2019.2 I was able to get around this with the --extra-filerefs arg, but I guess this doesn't work anymore with 3002.1 (version I am on now)? I get the TemplateNotFound errors now. This has halted my ability to manage some remote systems with salt-ssh. The nginx and sudoers formulas are having the same problem. It seems that any affected formula will need to be updated to work similar to what had to be done with the postfix one?

from redis-formula.

MemoryLeak55 avatar MemoryLeak55 commented on August 22, 2024

I checked and it seems that I have fixed it locally. I apologise for not making a pull request, it's not something I've ever actually done on github. But I will paste my changes here in the interest of speed.

This is for redis/server.sls. You may or may not need the gid_from_name -> usergroup fix. Otherwise, you need to add two lines to the redis_config block, pushing the redis_settings as context to the settings files it's going to render.

diff --git a/redis/server.sls b/redis/server.sls
index 34e67b9..1de77c3 100644
--- a/redis/server.sls
+++ b/redis/server.sls
@@ -30,7 +30,7 @@ redis_group:
 redis_user:
   user.present:
     - name: {{ user }}
-    - gid_from_name: True
+    - usergroup: True
     - home: {{ home }}
     - require:
       - group: redis_group
@@ -84,6 +84,9 @@ redis_config:
 {% else %}
     - source: {{ redis_settings.source_path }}
 {% endif %}
+    - context:
+      redis_settings: {{ redis_settings|tojson }}
+

 {% if install_from == 'source' %}
 redis-initd:

I'm not going to paste the diff for the following part, because it there are many files it touches and it's all the same change. In redis/files/*.jinja you will find lines such as

{% from "redis/map.jinja" import redis_settings with context %}

Remove all instances of that line in all the files you find it in redis/files/, as it's the one causing the trouble.

I needed to make no more changes for it to work

from redis-formula.

infoveinx avatar infoveinx commented on August 22, 2024

No worries. After posting I realized this isn't the appropriate place since it's the redis formula (same problems though). It's late, I should sleep. I looked at some of the other affected formulas but they are quite large and complex for me to work on fixing.

from redis-formula.

MemoryLeak55 avatar MemoryLeak55 commented on August 22, 2024

Sorry, it seems my reading comprehension went out the door, you did mention you had the issue with postfix and not redis. The postfix fix is nearly identical in terms of adding context in the .sls file that has the block that renders the config files themselves and removing some imports from files it renders, but as you've said this isn't the appropriate place

from redis-formula.

tacerus avatar tacerus commented on August 22, 2024

Remove all instances of that line in all the files you find it in redis/files/, as it's the one causing the trouble.

The solution is to not use map.jinja anymore?

from redis-formula.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.