---
- name: Update all log directories
  ansible.builtin.command: |
    ../files/update-log-dir.sh
  changed_when: true
  notify:
    - Restart elasticsearch
    - Restart Nginx

- name: Update log directory for Redis
  ansible.builtin.lineinfile:
    path: /etc/redis/redis.conf
    regexp: "^logfile .*"
    line: "logfile /apps/squirro/var/log/redis/redis.log"
  notify: Restart redis server

- name: Update log directory for Redis cache
  ansible.builtin.lineinfile:
    path: /etc/redis/cache.conf
    regexp: "^logfile .*"
    line: "logfile /apps/squirro/var/log/redis/cache.log"
  notify: Restart redis server cache
