Aucune description
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

monit.yml 2.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. - name: Add monitoring vhost to apache
  2. copy: src=etc_apache2_sites-available_00-status.conf dest=/etc/apache2/sites-available/00-status.conf
  3. - name: Enable the status vhost
  4. command: a2ensite 00-status.conf creates=/etc/apache2/sites-enabled/00-status.conf
  5. notify: restart apache
  6. - name: Install monit
  7. apt:
  8. name: monit
  9. state: present
  10. tags:
  11. - dependencies
  12. - name: Copy monit master config file into place
  13. template: src=etc_monit_monitrc.j2 dest=/etc/monit/monitrc
  14. notify: restart monit
  15. - name: Determine if ZNC is installed
  16. stat: path=/usr/lib/znc/configs/znc.conf
  17. register: znc_config_file
  18. - name: Determine if XMPP is installed
  19. stat: path=/etc/prosody/prosody.cfg.lua
  20. register: prosody_config_file
  21. - name: Determine if Fathom is installed
  22. stat: path=/usr/local/bin/fathom
  23. register: fathom_config_file
  24. - name: Determine if Redis is installed
  25. stat: path=/etc/redis/redis.conf
  26. register: redis_config_file
  27. - name: Determine if RSpamD is installed
  28. stat: path=/etc/rspamd/rspamd.conf
  29. register: rspamd_config_file
  30. - name: Determine if gitea is installed
  31. stat: path=/etc/gitea/app.ini
  32. register: gitea_config_file
  33. - name: Copy ZNC monit service config files into place
  34. copy: src=etc_monit_conf.d_znc dest=/etc/monit/conf.d/znc
  35. notify: restart monit
  36. when: znc_config_file.stat.exists == True
  37. - name: Copy XMPP monit service config files into place
  38. copy: src=etc_monit_conf.d_prosody dest=/etc/monit/conf.d/prosody
  39. notify: restart monit
  40. when: prosody_config_file.stat.exists == True
  41. - name: Copy Fathom monit service config files into place
  42. copy: src=etc_monit_conf.d_fathom dest=/etc/monit/conf.d/fathom
  43. notify: restart monit
  44. when: fathom_config_file.stat.exists == True
  45. - name: Copy Redis monit service config files into place
  46. copy: src=etc_monit_conf.d_redis dest=/etc/monit/conf.d/redis
  47. notify: restart monit
  48. when: redis_config_file.stat.exists == True
  49. - name: Copy RSpamD monit service config files into place
  50. copy: src=etc_monit_conf.d_rspamd dest=/etc/monit/conf.d/rspamd
  51. notify: restart monit
  52. when: rspamd_config_file.stat.exists == True
  53. - name: Copy gitea monit service config files into place
  54. copy: src=etc_monit_conf.d_gitea dest=/etc/monit/conf.d/gitea
  55. notify: restart monit
  56. when: gitea_config_file.stat.exists == True
  57. - name: Copy monit service config files into place
  58. copy: src=etc_monit_conf.d_{{ item }} dest=/etc/monit/conf.d/{{ item }}
  59. with_items:
  60. - apache2
  61. - dovecot
  62. - pgsql
  63. - postfix
  64. - sshd
  65. - tomcat
  66. notify: restart monit