init.sls 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. #
  2. # Icingaweb2
  3. #
  4. {% set roles = salt['pillar.get']('nodes:' ~ grains.id ~ ':roles', []) %}
  5. {% set icingaweb2_config = salt['pillar.get']('monitoring:icingaweb2') %}
  6. include:
  7. - apt
  8. - sudo
  9. - needrestart
  10. - icinga2
  11. # Install icingaweb2 package
  12. icingaweb2-pkgs:
  13. pkg.installed:
  14. - pkgs:
  15. - icingaweb2
  16. - icingaweb2-module-monitoring
  17. - icinga2-ido-mysql
  18. - require:
  19. - file: /etc/apt/sources.list.d/icinga.list
  20. # Install monitoring module configs
  21. monitoring-module:
  22. file.recurse:
  23. - name: /etc/icingaweb2/modules/monitoring/
  24. - source: salt://icingaweb2/modules/monitoring/
  25. - file_mode: 660
  26. - dir_mode: 2770
  27. - user: www-data
  28. - group: icingaweb2
  29. /etc/icingaweb2/authentication.ini:
  30. file.managed:
  31. - source: salt://icingaweb2/authentication.ini.tmpl
  32. - mode: 660
  33. - user: www-data
  34. - group: icingaweb2
  35. - template: jinja
  36. - context:
  37. icingaweb2_config: {{ icingaweb2_config }}
  38. - require:
  39. - pkg: icingaweb2-pkgs
  40. /etc/icingaweb2/roles.ini:
  41. file.managed:
  42. - source: salt://icingaweb2/roles.ini.tmpl
  43. - mode: 660
  44. - user: www-data
  45. - group: icingaweb2
  46. - template: jinja
  47. - context:
  48. icingaweb2_config: {{ icingaweb2_config }}
  49. - require:
  50. - pkg: icingaweb2-pkgs
  51. /etc/icingaweb2/groups.ini:
  52. file.managed:
  53. - source: salt://icingaweb2/groups.ini.tmpl
  54. - mode: 660
  55. - user: www-data
  56. - group: icingaweb2
  57. - template: jinja
  58. - context:
  59. icingaweb2_config: {{ icingaweb2_config }}
  60. - require:
  61. - pkg: icingaweb2-pkgs
  62. /etc/icingaweb2/resources.ini:
  63. file.managed:
  64. - source: salt://icingaweb2/resources.ini.tmpl
  65. - mode: 660
  66. - user: www-data
  67. - group: icingaweb2
  68. - template: jinja
  69. - context:
  70. icingaweb2_config: {{ icingaweb2_config }}
  71. - require:
  72. - pkg: icingaweb2-pkgs
  73. /etc/icingaweb2/navigation/menu.ini:
  74. file.managed:
  75. - source: salt://icingaweb2/menu.ini.tmpl
  76. - mode: 660
  77. - user: www-data
  78. - group: icingaweb2
  79. - template: jinja
  80. - context:
  81. icingaweb2_config: {{ icingaweb2_config }}
  82. - require:
  83. - pkg: icingaweb2-pkgs