---
- name: aerc | Create config directories
  file:
    path: '{{ xdg_dir.config_home }}/aerc/{{ item }}'
    state: directory
    mode: '755'
  loop:
    - stylesets
    - filters
    - templates

# Default binds.conf is fine. No need to include here
- name: aerc | Copy config file
  template:
    src: aerc/aerc.j2
    dest: '{{ xdg_dir.config_home }}/aerc/aerc.conf'
    mode: '644'

- name: aerc | Copy stylesets
  template:
    src: 'aerc/stylesets/{{ item }}.j2'
    dest: '{{ xdg_dir.config_home }}/aerc/stylesets/{{ item }}'
    mode: '644'
  loop:
    - blue
    - green
    - purple

- name: aerc | Copy mail templates
  copy:
    src: aerc/templates/
    dest: '{{ xdg_dir.config_home }}/aerc/templates/'
    mode: '644'

- name: aerc | Copy text/html filter
  copy:
    src: aerc/html
    dest: '{{ xdg_dir.config_home }}/aerc/filters/html'
    mode: '755'
