---
- name: Install goimapnotify
  pacman:
    name: goimapnotify
    state: present

- name: Create goimapnotify service override directory
  file:
    path: /etc/systemd/user/goimapnotify@.service.d
    state: directory
  when: mail.goimapnotify_wait is defined

- name: Push goimapnotify service override file
  template:
    src: goimapnotify-service-override.conf.j2
    dest: /etc/systemd/user/goimapnotify@.service.d/override.conf
  when: mail.goimapnotify_wait is defined
  notify:
    - reload user systemd config
