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

# gallery-dl will complain that ~/.local/share/gallery-dl/log.txt is missing
# This path is configured inside the config file, so create it as desired
- name: gallery-dl | Create directory in {{ xdg_dir.data_home }}
  file:
    path: '{{ xdg_dir.data_home }}/gallery-dl'
    state: directory
    mode: '755'

- name: gallery-dl | Copy config
  template:
    src: gallery-dl/config.j2
    dest: '{{ xdg_dir.config_home }}/gallery-dl/config.json'
    mode: '600'
