Search code examples
jinja2salt-project

Render template file and get the content without applying the state


I know that state.show_sls renders and display a state.

I would like to know how to render a template file that is used inside a state and display its content without needing to apply the state.

Is there a way to use the salt's jinja renderer from the command line to do that?


Solution

  • After some research I have come to the command salt.module.cp and it goes like this:

    salt-call cp.get_template salt://file.jinja /dev/stdout

    It renders a file as a template and prints it on the terminal.

    I use it a lot while developing formulas to check my templates.