host.conf.tmpl 825 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #
  2. # {{ node_id }}
  3. #
  4. {%- set roles = node_config.get ('roles', []) %}
  5. {%- set sites = node_config.get ('sites', []) %}
  6. {%- set address = salt['ffho_net.get_loopback_ip'] (node_config, node_id, 'v4') %}
  7. {%- set address6 = salt['ffho_net.get_loopback_ip'] (node_config, node_id, 'v6') %}
  8. {%- if 'icinga2server' not in roles %}
  9. object Endpoint "{{ node_id }}" {
  10. host = "{{ node_id }}"
  11. }
  12. object Zone "{{ node_id }}" {
  13. endpoints = [ "{{ node_id }}" ]
  14. parent = "master"
  15. }
  16. {%- endif %}
  17. object Host "{{ node_id }}" {
  18. import "generic-host"
  19. display_name = "{{ node_id }}"
  20. address = "{{ address }}"
  21. address6 = "{{ address6 }}"
  22. vars.os = "Linux"
  23. vars.roles = [
  24. {%- for role in roles|sort %}
  25. "{{ role }}",
  26. {%- endfor %}
  27. ]
  28. vars.sites = [
  29. {%- for site in sites|sort %}
  30. "{{ site }}",
  31. {%- endfor %}
  32. ]
  33. }