23 lines
499 B
Django/Jinja
23 lines
499 B
Django/Jinja
# File managed by Ansible
|
|
|
|
# HOST DEFINITION
|
|
define host{
|
|
{% for key, value in item.items() %}
|
|
{% if key != "services" %}
|
|
{{ key }} {{ value }}
|
|
{% endif %}
|
|
{% endfor %}
|
|
}
|
|
|
|
{% if 'services' in item %}
|
|
# SERVICES DEFINITION
|
|
{% for service in item.services %}
|
|
|
|
define service{
|
|
host {{ item.host_name }}
|
|
{% for key, value in service.items() %}
|
|
{{ key }} {% if key == "service_description" %}{{ value | replace(" ", "_") }}{% else %}{{ value }}{% endif %}
|
|
|
|
{% endfor %}
|
|
}
|
|
{% endfor %}{% endif %}
|