mon.yml 1023 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. - name: Install mon packages
  2. apt: pkg=mon state=installed
  3. - name: Create need directory for mon configuration
  4. file: path=/etc/mon/mon.d state=directory owner=root group=root mode=0755
  5. - name: Install mon configuration
  6. template: src=mon/{{ ansible_hostname }}.conf.j2 dest=/etc/mon/mon.cf owner=root group=root mode=0644
  7. notify:
  8. - Restart mon
  9. - name: Install mon (default) configuration
  10. template: src=mon/default.j2 dest=/etc/default/mon owner=root group=root mode=0644
  11. notify:
  12. - Restart mon
  13. - name: Install custom mon plugins
  14. copy: src=mon/{{ item }}.monitor dest=/etc/mon/mon.d/{{ item }}.monitor owner=root group=root mode=0755
  15. with_items:
  16. - https
  17. - imaps
  18. - dns
  19. notify:
  20. - Restart mon
  21. - name: Install mon plugins
  22. file: src=/usr/lib/mon/mon.d/{{ item }}.monitor path=/etc/mon/mon.d/{{ item }}.monitor state=link
  23. with_items:
  24. - fping
  25. - http
  26. - smtp
  27. - imap
  28. - tcp
  29. notify:
  30. - Restart mon
  31. - name: Ensure mon is running
  32. service: name=mon state=started