---
- name: castero | Create config directory
  file:
    path: '{{ xdg_dir.config_home }}/castero'
    state: directory
    mode: '755'

- name: castero | Copy podcast list and configuration file
  copy:
    src: castero/{{ item }}
    dest: '{{ xdg_dir.config_home }}/castero/{{ item }}'
    mode: '644'
  loop:
    - castero.conf
    - podcasts.opml

- name: castero | Import the list of podcasts
  command:
    cmd: /usr/bin/castero --import {{ xdg_dir.config_home }}/castero/podcasts.opml
    removes: /usr/bin/castero
