I have a templated SLS in Salt I'm trying to build, but it's emitting invalid syntax, which is resulting in errors such as:
my-minion-id:
- State 'system' in SLS 'network' is not formed as a list
In principle, it should be possible to, somehow examine the output of the Jinja template before it attempts to parse the output as an SLS file. There exists a Python module for the Jinja renderersalt.renderers.jinja, but if I attempt to execute it on the CLI, I get an error:
# salt my-minion-id salt.renderers.jinja.render /srv/salt/network/init.sls
my-minion-id:
'salt.renderers.jinja.render' is not available.
ERROR: Minions returned with non-zero exit code
# salt my-minion-id renderers.jinja.render /srv/salt/network/init.sls
my-minion-id:
'renderers.jinja.render' is not available.
ERROR: Minions returned with non-zero exit code
How can I see the output of my template? It seems absurd it should be this difficult to debug.
salt-call cp.get_template salt://foo.sls /dev/stdout– emorris Sep 18 '20 at 10:44pillarenv=baseand the normal override mechanism (specifying pillarenv on the command line) does not work as far as I can tell. Workaround is to update the config sopillarenv=basetemporarily, which is a pain but does work. – Matthew Newton Jan 07 '22 at 23:31