- name: Create mysqld_exporter directory
  file: path=/usr/local/mysqld_exporter state=directory mode=0755

- name: Copy Mysqld_exporter Packages
  copy: src={{ item }} dest=/usr/local/mysqld_exporter
  with_items:
    - mysqld_exporter
    - my.cnf

- name: Modifying File mysqld_exporter
  file: path=/usr/local/mysqld_exporter/mysqld_exporter owner=root group=root mode=0755

- name: Copy Mysqld_exporter Start Files
  copy: src='mysqld_exporter.service' dest='/usr/lib/systemd/system'
  notify:
    - System reload

- name: Set mysqld_exporter service status
  service: name=mysqld_exporter state=started enabled=yes
  notify:
    - restart mysqld_exporter service

