- name: Install dependencies
  action: apt pkg={{item}} state=installed
  with_items:
       - curl
       - facter
       - iptables
       - fail2ban
       - redis-server

- name: configure redis server
  template: src=redis.conf.j2 dest=/etc/redis/redis.conf
  notify: restart redis

- name: download redis prometheus exporter
  get_url:
    url: https://github.com/oliver006/redis_exporter/releases/download/v0.12.2/redis_exporter-v0.12.2.linux-amd64.tar.gz
    dest: /var/tmp/redis_exporter.tar.gz

- name: decompress redis_exporter
  unarchive:
    src: /var/tmp/redis_exporter.tar.gz
    dest: /usr/local/bin/
    remote_src: yes
    owner: redis
    mode: 0711

- name: install redis_exporter service
  template: src=redis-exporter.service.j2 dest=/etc/systemd/system/redis-exporter.service

- name: enable redis_exporter service
  service: name=redis_exporter state=started

- name: Install dependencies
  action: apt pkg={{item}} state=installed
  with_items:
       - curl
       - facter
       - iptables
       - fail2ban
       - redis-server

- name: configure redis server
  template: src=redis.conf.j2 dest=/etc/redis/redis.conf
  notify: restart redis

- name: download redis prometheus exporter
  get_url:
    url: https://github.com/oliver006/redis_exporter/releases/download/v0.12.2/redis_exporter-v0.12.2.linux-amd64.tar.gz
    dest: /var/tmp/redis_exporter.tar.gz

- name: decompress redis_exporter
  unarchive:
    src: /var/tmp/redis_exporter.tar.gz
    dest: /usr/local/bin/
    remote_src: yes
    owner: redis
    mode: 0711

- name: install redis_exporter service
  template: src=redis-exporter.service.j2 dest=/etc/systemd/system/redis-exporter.service

- name: enable redis_exporter service
  service: name=redis-exporter state=started

Fix service name for redis-exporter
Fix service name for redis-exporter
