- name: Create config for Zabbix copy: src=mysql.conf dest=/etc/zabbix/zabbix_agentd.d/mysql.conf notify: - restart zabbix-agent - name: Create mysql scripts directory file: path: /etc/zabbix/scripts/mysql state: directory mode: 0755 - name: Create script for Zabbix copy: src: get_mysql_stats_wrapper.sh dest: /etc/zabbix/scripts/mysql/get_mysql_stats_wrapper.sh mode: 0744 backup: yes notify: - restart zabbix-agent - name: Create script for Zabbix copy: src: ss_get_mysql_stats.php dest: /etc/zabbix/scripts/mysql/ss_get_mysql_stats.php mode: 0744 backup: yes notify: - restart zabbix-agent - name: Create accesses rights config template: src=ss_get_mysql_stats.php.cnf.j2 dest=/etc/zabbix/scripts/mysql/ss_get_mysql_stats.php.cnf notify: - restart zabbix-agent - name: Create accesses rights config template: src=my.cnf.j2 dest=/etc/zabbix/scripts/mysql/my.cnf notify: - restart zabbix-agent