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.

55 lines
1.4 KiB

  1. object Host "{{ item.key }}" {
  2. import "generic-host"
  3. address = "{{ item.value.address }}"
  4. vars.os = "Linux"
  5. vars.sla = "24x7"
  6. {% if ('agent_type' in item.value) and (item.value.agent_type == 'ssh') %}
  7. vars.agent_type = "ssh"
  8. {% endif %}
  9. vars.host_type = "{{ item.value.host_type | d('physical') }}"
  10. {% for var in item.value.vars|d({})|dict2items %}
  11. vars.{{ var.key }} = "{{ var.value }}"
  12. {% endfor %}
  13. {% for vhost in item.value.vhosts|d([]) %}
  14. object Host "{{ vhost }}" {
  15. import "generic-host"
  16. check_command = "dummy"
  17. display_name = "www/{{ vhost }}"
  18. vars.sla = "24x7"
  19. vars.host_type = "web service"
  20. vars.dns_a_record = "{{ public_ip }}"
  21. vars.http_vhosts["https cert"] = {
  22. http_address = "{{ item.value.address }}"
  23. http_ssl = true
  24. http_vhost = "{{ vhost }}"
  25. http_onredirect = "sticky"
  26. http_sni = true
  27. /* Check remaining days before cert expiration */
  28. http_certificate = "30,20"
  29. }
  30. {% for uri, prop in (item.value.vhosts_uri[vhost]|d({'/': {}})).items() %}
  31. vars.http_vhosts["https service"] = {
  32. http_address = "{{ item.value.address }}"
  33. http_ssl = true
  34. http_vhost = "{{ vhost }}"
  35. http_onredirect = "{{ prop.onredirect|d('sticky') }}"
  36. http_sni = true
  37. http_uri = "{{ uri }}"
  38. {% if prop.content|d('') != '' %}http_string = "{{ prop.content|replace('"','\\"') }}"{% endif %}
  39. }
  40. {% endfor %}
  41. }
  42. {% endfor %}