main.yml 1003 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. - name: Create config for Zabbix
  2. copy: src=mysql.conf dest=/etc/zabbix/zabbix_agentd.d/mysql.conf
  3. notify:
  4. - restart zabbix-agent
  5. - name: Create mysql scripts directory
  6. file:
  7. path: /etc/zabbix/scripts/mysql
  8. state: directory
  9. mode: 0755
  10. - name: Create script for Zabbix
  11. copy:
  12. src: get_mysql_stats_wrapper.sh
  13. dest: /etc/zabbix/scripts/mysql/get_mysql_stats_wrapper.sh
  14. mode: 0744
  15. backup: yes
  16. notify:
  17. - restart zabbix-agent
  18. - name: Create script for Zabbix
  19. copy:
  20. src: ss_get_mysql_stats.php
  21. dest: /etc/zabbix/scripts/mysql/ss_get_mysql_stats.php
  22. mode: 0744
  23. backup: yes
  24. notify:
  25. - restart zabbix-agent
  26. - name: Create accesses rights config
  27. template:
  28. src=ss_get_mysql_stats.php.cnf.j2
  29. dest=/etc/zabbix/scripts/mysql/ss_get_mysql_stats.php.cnf
  30. notify:
  31. - restart zabbix-agent
  32. - name: Create accesses rights config
  33. template:
  34. src=my.cnf.j2
  35. dest=/etc/zabbix/scripts/mysql/my.cnf
  36. notify:
  37. - restart zabbix-agent