Skip to content
Snippets Groups Projects
Commit c120e2da authored by Théo - Le Filament's avatar Théo - Le Filament
Browse files

feat: check all service URLs

parent 1ceaa49c
No related branches found
No related tags found
No related merge requests found
...@@ -90,7 +90,7 @@ define host{ ...@@ -90,7 +90,7 @@ define host{
define servicegroup{ define servicegroup{
servicegroup_name web-services servicegroup_name web-services
alias Services Web alias Services Web
members {% for host in groups['odoo_server'] | sort %}{{ host }},Odoo {{ hostvars[host].odoo_url }},{% endfor %}{% for host in groups['owncloud_server'] | sort %}{{ host }},OwnCloud {{ hostvars[host].cloud_url }},{% endfor %}{% for host in groups['docker_odoo'] | sort %}{% for name, values in hostvars[host].odoo_instances.items() | default([]) %}{{ host }},{{ name }} server {{ values.url }},{% endfor %}{% endfor %}{% for host in groups['docker_owncloud'] | union(groups['docker_nextcloud']) | sort %}{{ host }},Cloud Server {{ hostvars[host].cloud_url }},{% if hostvars[host].cloud_onlyoffice is defined %}{{ host }},OnlyOffice Server {{ hostvars[host].cloud_onlyoffice_url }},{% endif %}{% endfor %}{% for host in groups['docker_auth'] | sort %}{% if loop.index == loop.length %}{{ host }},PhpLdapAdmin {{ hostvars[host].ldap_url }},{{ host }},SSO Server {{ hostvars[host].sso_url }}{% else %}{{ host }},PhpLdapAdmin {{ hostvars[host].ldap_url }},{{ host }},SSO Server {{ hostvars[host].sso_url }},{% endif %}{% endfor %} members {% for host in groups['odoo_server'] | sort %}{{ host }},Odoo {{ hostvars[host].odoo_url }},{% endfor %}{% for host in groups['owncloud_server'] | sort %}{{ host }},OwnCloud {{ hostvars[host].cloud_url }},{% endfor %}{% for host in groups['docker_odoo'] | sort %}{% for name, values in hostvars[host].odoo_instances.items() | default([]) %}{% if values.url is defined %}{{ host }},{{ name }} server {{ values.url }},{% endif %}{% if values.domains is defined and values.domains is string %}{{ host }},{{ name }} server {{ values.domains }},{% else %}{% for domain in values.domains | default([]) %}{{ host }},{{ name }} server {{ domain }},{% endfor %}{% endif %}{% endfor %}{% endfor %}{% for host in groups['docker_owncloud'] | union(groups['docker_nextcloud']) | sort %}{{ host }},Cloud Server {{ hostvars[host].cloud_url }},{% if hostvars[host].cloud_onlyoffice is defined %}{{ host }},OnlyOffice Server {{ hostvars[host].cloud_onlyoffice_url }},{% endif %}{% endfor %}{% for host in groups['docker_auth'] | sort %}{% if loop.index == loop.length %}{{ host }},PhpLdapAdmin {{ hostvars[host].ldap_url }},{{ host }},SSO Server {{ hostvars[host].sso_url }}{% else %}{{ host }},PhpLdapAdmin {{ hostvars[host].ldap_url }},{{ host }},SSO Server {{ hostvars[host].sso_url }},{% endif %}{% endfor %}
} }
......
...@@ -327,12 +327,31 @@ define service{ ...@@ -327,12 +327,31 @@ define service{
{% endif %} {% endif %}
{% for name, values in hostvars[host].odoo_instances.items() | default([]) %} {% for name, values in hostvars[host].odoo_instances.items() | default([]) %}
{% if values.url is defined %}
define service{ define service{
use generic-service use generic-service
host_name {{ host }} host_name {{ host }}
service_description {{ name }} server {{ values.url }} service_description {{ name }} server {{ values.url }}
check_command check_https!'{{ values.url }}'!/web/login check_command check_https!'{{ values.url }}'!/web/login
} }
{% endif %}
{% if values.domains is defined and values.domains is string %}
define service{
use generic-service
host_name {{ host }}
service_description {{ name }} server {{ values.domains }}
check_command check_https!'{{ values.domains }}'!/web/login
}
{% else %}
{% for domain in values.domains | default([]) %}
define service{
use generic-service
host_name {{ host }}
service_description {{ name }} server {{ domain }}
check_command check_https!'{{ domain }}'!/web/login
}
{% endfor %}
{% endif %}
# Docker {{ name }} instance # Docker {{ name }} instance
define service{ define service{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment