ansible/roles/monit-dashboard/templates/servers.json

15 lines
585 B
JSON

{
"dispatcher": {
"url": "http://{{ monit_dashboard_address }}:2812",
"user": "{{ monit_web_user }}",
"passwd": "{{ monit_web_pasword }}"
}{{ "," if groups['frames'] is defined and (groups['frames']|length>0) else "" }}
{% for frame in groups['frames'] %}
"{{ hostvars[frame].inventory_hostname }}": {
"url": "http://{{ hostvars[frame].monit_dashboard_address }}:2812",
"user": "{{ hostvars[frame].monit_web_user }}",
"passwd": "{{ hostvars[frame].monit_web_pasword }}"
}{{ "," if not loop.last else "" }}
{% endfor %}
}