Playbooks to a new Lilik
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

43 lines
1.2 KiB

object Host "{{ item.key }}" {
import "generic-host"
address = "{{ item.value.address }}"
vars.os = "Linux"
vars.sla = "24x7"
{% if ('agent_type' in item.value) and (item.value.agent_type == 'ssh') %}
vars.agent_type = "ssh"
{% endif %}
vars.host_type = "{{ item.value.host_type | d('physical') }}"
{% for var in item.value.vars|d({})|dict2items %}
vars.{{ var.key }} = "{{ var.value }}"
{% endfor %}
{% if 'vhosts' in item.value %}
{% for vhost in item.value.vhosts %}
vars.http_vhosts["https cert: {{ vhost }}"] = {
http_ssl = true
http_vhost = "{{ vhost }}"
http_onredirect = "sticky"
http_sni = true
/* Check remaining days before cert expiration */
http_certificate = "30,20"
}
{% for uri, prop in (item.value.vhosts_uri[vhost]|d({'/': {}})).items() %}
vars.http_vhosts["https service: {{ vhost }}{{ uri }}"] = {
http_ssl = true
http_vhost = "{{ vhost }}"
http_onredirect = "{{ prop.onredirect|d('sticky') }}"
http_sni = true
http_uri = "{{ uri }}"
{% if prop.content|d('') != '' %}http_string = "{{ prop.content|replace('"','\\"') }}"{% endif %}
}
{% endfor %}
{% endfor %}
{% endif %}
}