-
-
Save chadhs/0ef0a81ef3fcb8ea2622 to your computer and use it in GitHub Desktop.
managing multiple versions of a config per role or nodegroup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FreeBSD-01: | |
Data failed to compile: | |
---------- | |
Rendering SLS config failed, render error: Traceback (most recent call last): | |
File "/usr/local/lib/python2.7/site-packages/salt/utils/templates.py", line 63, in render_tmpl | |
output = render_str(tmplstr, context, tmplpath) | |
File "/usr/local/lib/python2.7/site-packages/salt/utils/templates.py", line 116, in render_jinja_tmpl | |
output = jinja_env.from_string(tmplstr).render(**context) | |
File "/usr/local/lib/python2.7/site-packages/Jinja2-2.7-py2.7.egg/jinja2/environment.py", line 969, in render | |
return self.environment.handle_exception(exc_info, True) | |
File "/usr/local/lib/python2.7/site-packages/Jinja2-2.7-py2.7.egg/jinja2/environment.py", line 742, in handle_exception | |
reraise(exc_type, exc_value, tb) | |
File "<template>", line 8, in top-level template code | |
UndefinedError: 'dict object' has no attribute 'roles' | |
Traceback (most recent call last): | |
File "/usr/local/lib/python2.7/site-packages/salt/state.py", line 1877, in render_state | |
rendered_sls=mods | |
File "/usr/local/lib/python2.7/site-packages/salt/template.py", line 68, in compile_template | |
ret = render(input_data, env, sls, **render_kwargs) | |
File "/usr/local/lib/python2.7/site-packages/salt/renderers/jinja.py", line 41, in render | |
tmp_data.get('data', 'Unknown render error in jinja renderer') | |
SaltRenderError: Traceback (most recent call last): | |
File "/usr/local/lib/python2.7/site-packages/salt/utils/templates.py", line 63, in render_tmpl | |
output = render_str(tmplstr, context, tmplpath) | |
File "/usr/local/lib/python2.7/site-packages/salt/utils/templates.py", line 116, in render_jinja_tmpl | |
output = jinja_env.from_string(tmplstr).render(**context) | |
File "/usr/local/lib/python2.7/site-packages/Jinja2-2.7-py2.7.egg/jinja2/environment.py", line 969, in render | |
return self.environment.handle_exception(exc_info, True) | |
File "/usr/local/lib/python2.7/site-packages/Jinja2-2.7-py2.7.egg/jinja2/environment.py", line 742, in handle_exception | |
reraise(exc_type, exc_value, tb) | |
File "<template>", line 8, in top-level template code | |
UndefinedError: 'dict object' has no attribute 'roles' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### configs | |
/usr/local/etc/pkg.conf: | |
file: | |
- managed | |
- source: | |
- salt://configs/{{ grains['roles'] }}-pkg.conf | |
- salt://configs/pkg.conf | |
- user: root | |
- group: wheel | |
- mode: 644 | |
- require: | |
- pkg: pkg | |
pkg: | |
pkg: | |
- installed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
{{ salt['grains.get']('nodename', 'default value') }}