# salt '*' state.highstate test=True
foo:
Data failed to compile:
----------
Rendering SLS "base:nagios.nrpe" failed: Jinja error: Undefined is not JSON serializable
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/salt/utils/templates.py", line 261, in render_jinja_tmpl
output = jinja_env.from_string(tmplstr).render(**unicode_context)
File "/usr/lib/python2.7/dist-packages/jinja2/environment.py", line 894, in render
return self.environment.handle_exception(exc_info, True)
File "<template>", line 6, in top-level template code
File "/usr/lib/python2.7/dist-packages/salt/utils/jinja.py", line 302, in format_json
return Markup(json.dumps(value, sort_keys=True).strip())
File "/usr/lib/python2.7/json/__init__.py", line 238, in dumps
**kw).encode(obj)
File "/usr/lib/python2.7/json/encoder.py", line 202, in encode
chunks = list(chunks)
File "/usr/lib/python2.7/json/encoder.py", line 435, in _iterencode
o = _default(o)
File "/usr/lib/python2.7/json/encoder.py", line 177, in default
raise TypeError(repr(o) + " is not JSON serializable")
TypeError: Undefined is not JSON serializable
; line 6
---
{% from "nagios/nrpe/map.jinja" import map with context %}
nrpe:
pkg:
- installed
- pkgs: {{ map.pkgs|json }} <======================
service:
- running
- name: {{ map.service }}
- enable: true
group:
[...]
---
A comparable error is thrown for nagios or nagios.server and it is obvious that this formula does not support Debian at all. It should also be noted that the configuration directories, the created user and groups along with their respective home directories are not appropriate on Debian and that the corresponding sections in this formula should be adapted.