---
- name: create vdirsyncer directory
  file:
    path: '{{ item }}'
    state: directory
  loop:
    - ~/.vdirsyncer/
    - ~/.config/khal/
    - ~/.config/khard/
    - ~/.vdirsyncer/khal/
    - ~/.vdirsyncer/khard/

- name: copy vdirsyncer config
  template:
    src: vdirsyncer.j2
    dest: ~/.vdirsyncer/config

- name: copy khal config
  template:
    src: khal.j2
    dest: ~/.config/khal/config

- name: copy khard config
  template:
    src: khard.j2
    dest: ~/.config/khard/khard.conf

- name: vdirsyncer init
  shell: yes | vdirsyncer discover
  ignore_errors: yes
