Created
December 2, 2016 19:30
-
-
Save UtahCampusD/b43543c4a1eb2a781b2df01a5d39c2e4 to your computer and use it in GitHub Desktop.
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
- Rendering SLS 'base:stats.syslog.syslog' failed: Jinja error: argument of type 'function' is not iterable | |
Traceback (most recent call last): | |
File "/usr/lib/python2.7/site-packages/salt/utils/templates.py", line 368, in render_jinja_tmpl | |
output = template.render(**decoded_context) | |
File "/usr/lib/python2.7/site-packages/jinja2/environment.py", line 969, in render | |
return self.environment.handle_exception(exc_info, True) | |
File "/usr/lib/python2.7/site-packages/jinja2/environment.py", line 742, in handle_exception | |
reraise(exc_type, exc_value, tb) | |
File "<template>", line 38, in top-level template code | |
TypeError: argument of type 'function' is not iterable | |
; line 38 | |
--- | |
[...] | |
{% set master_dirs = salt['cp.list_master_dirs'] %} | |
# # Check if minion has custom directory | |
{% if custom_syslog_dir in master_dirs %} <====================== | |
# Execute if directory exists | |
custom-syslog: | |
file.recurse: | |
- name: /etc/rsyslog.d | |
- user: root | |
[...] | |
--- | |
# Custom configs | |
{% set host = grains['host'] %} | |
{% set custom_syslog_dir = 'stats/syslog/files/custom/'~host %} | |
{% set master_dirs = salt['cp.list_master_dirs'] %} | |
# # Check if minion has custom directory | |
{% if custom_syslog_dir in master_dirs %} | |
# Execute if directory exists | |
custom-syslog: | |
file.recurse: | |
- name: /etc/rsyslog.d | |
- user: root | |
- group: root | |
- dir_mode: 2775 | |
- file_mode: 0644 | |
- source: salt://stats/syslog/files/custom/{{host}} | |
- require: | |
- pkg: syslog-installed | |
{% endif %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment