Skip to content

Instantly share code, notes, and snippets.

@BretFisher

BretFisher/Log Secret

Last active August 29, 2015 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BretFisher/5be22f2df7b81bee9f38 to your computer and use it in GitHub Desktop.
Save BretFisher/5be22f2df7b81bee9f38 to your computer and use it in GitHub Desktop.
Test Jinja Not working, just want a list of server IP's
The result is a blank file and this error when running:
salt 'lb*' state.apply test
lb-dev-1:
----------
file_|-/opt/local/etc/nginx/upstream.conf_|-/opt/local/etc/nginx/upstream.conf_|-managed:
----------
__run_num__:
0
changes:
----------
comment:
Unable to manage file: Jinja variable 'str object' has no attribute 'items'
duration:
23.038
name:
/opt/local/etc/nginx/upstream.conf
result:
False
start_time:
18:38:16.946461
/opt/local/etc/nginx/upstream.conf:
file.managed:
- source: salt://lb/upstream.conf.jin
- template: jinja
{% for server,ip in salt['mine.get']('*', 'network.interfaces', ['eth0']).items() %}
server {{ server }} {{ ip }}
{% endfor %}
@BretFisher
Copy link
Author

@BretFisher
Copy link
Author

updated with corrected .jin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment