---
- name: Redis installed
  community.general.pkgng:
    name: "redis"
    state: latest

- name: Redis enabled
  shell: sysrc redis_enable="YES"

- name: Redis conf file installed
  template:
    src: redis.conf.j2
    dest: /usr/local/etc/redis.conf
    owner: root
    mode: 0644
  notify: Redis restarted

- name: Redis started
  service: name=redis state=started
