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

- name: Copy Node_exporter Packages
  copy: src={{ item }} dest=/usr/local/node_exporter
  with_items:
    - node_exporter

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

- name: Template node_exporter started file
  template: src='node_exporter.service.j2' dest='/usr/lib/systemd/system/node_exporter.service'
  notify:
    - System reload

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

