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.

65 lines
1.6 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 repo in item.value.borg_repos|d({})|dict2items %}
  14. vars.backup_repos["{{ repo.key }}"] = {
  15. {% for v in repo.value|dict2items %}
  16. {{ v.key }} = "{{ v.value }}"
  17. {% endfor %}
  18. }
  19. {% endfor %}
  20. }
  21. {% for vhost in item.value.vhosts|d([]) %}
  22. object Host "{{ vhost }}" {
  23. import "generic-host"
  24. check_command = "dummy"
  25. display_name = "www/{{ vhost }}"
  26. vars.sla = "24x7"
  27. vars.host_type = "web service"
  28. vars.dns_a_record = "{{ public_ip }}"
  29. vars.http_vhosts["https cert"] = {
  30. http_address = "{{ item.value.address }}"
  31. http_ssl = true
  32. http_vhost = "{{ vhost }}"
  33. http_onredirect = "sticky"
  34. http_sni = true
  35. /* Check remaining days before cert expiration */
  36. http_certificate = "30,20"
  37. }
  38. {% for uri, prop in (item.value.vhosts_uri[vhost]|d({'/': {}})).items() %}
  39. vars.http_vhosts["https service"] = {
  40. http_address = "{{ item.value.address }}"
  41. http_ssl = true
  42. http_vhost = "{{ vhost }}"
  43. http_onredirect = "{{ prop.onredirect|d('sticky') }}"
  44. http_sni = true
  45. http_uri = "{{ uri }}"
  46. {% if prop.content|d('') != '' %}http_string = "{{ prop.content|replace('"','\\"') }}"{% endif %}
  47. }
  48. {% endfor %}
  49. }
  50. {% endfor %}