Last active
January 31, 2017 09:40
-
-
Save joltcan/9d594825c9bef1965a1bc356308ba350 to your computer and use it in GitHub Desktop.
ansible jinja2 example for uniqe dict item (for icinga)
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
{% 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