Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ndobbs
Last active December 8, 2016 18:44
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 ndobbs/71461bdd4ed0423f61038351998fa573 to your computer and use it in GitHub Desktop.
Save ndobbs/71461bdd4ed0423f61038351998fa573 to your computer and use it in GitHub Desktop.
Salt for iteration spacing
{% for interface in salt['grains.get']('ip_interfaces') %}
{% if "lo" in interface or "eth0" in interface or "em1" in interface or "tun0" in interface %}
{% continue %}
{% else %}
here is an interface {{ interface }}
{% endif %}
{% endfor %}
---OUTPUT---
here is an interface em2
here is an interface p3p2
here is an interface p3p1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment