init.sls 2.0 KB

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