Skip to content

Instantly share code, notes, and snippets.

@joltcan
Last active January 31, 2017 09:40
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 joltcan/9d594825c9bef1965a1bc356308ba350 to your computer and use it in GitHub Desktop.
Save joltcan/9d594825c9bef1965a1bc356308ba350 to your computer and use it in GitHub Desktop.
ansible jinja2 example for uniqe dict item (for icinga)
{% set app = "" %}
{% for dict_item in icinga.application_services %}
{% if dict_item['application'] != app %}
{% set app = dict_item['application'] %}
define host{
use generic-host
host_name {{ app }}
}
{% endif %}
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment