3

I want to extend the jinja filters which are avaiable in SaltStack

I want to create a simple filter called rpm_to_debian_name

{ package-name | rpm_to_debian_name }

I only found docs about the salt specific filters: https://docs.saltstack.com/en/carbon/topics/jinja/index.html#filters

How to extend these filters?

BTW: implementing this filter is not part of this question. It is a simple python which is easy to implement. The question is how to make it available, where to put the code?

1 Answer 1

2
+50

Jinja is one of several renderers that Salt supports. The renderers code starts here: https://github.com/saltstack/salt/blob/develop/salt/renderers/jinja.py

but it looks like you would add your filter here:

https://github.com/saltstack/salt/blob/a875b9074207108233e96f9e35e630b75ce21cd8/salt/utils/templates.py#L347

I'm not sure if there's a place outside of Salt's codebase to plug that in. I hope that helps!

1
  • 2
    Thank you. Unfortunately the main part of my question is still open. How to plug something into this from a place outside of Salt's codebase? :-)
    – guettli
    Nov 1, 2016 at 14:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .