---
- name: animdl | Create directories
  file:
    path: '{{ item }}'
    state: directory
    mode: '755'
  loop:
    - '{{ xdg_dir.config_home }}/animdl'
    - ~/Downloads/animdl

- name: animdl | Copy config
  template:
    src: animdl/config.j2
    dest: '{{ xdg_dir.config_home }}/animdl/config.yml'
    mode: '644'

- name: animdl | Install animdl with pip
  pip:
    name: animdl
    virtualenv: '{{ xdg_dir.config_home }}/animdl/venv'
    state: latest

- name: animdl | Symlink animdl executable
  file:
    src: '{{ xdg_dir.config_home }}/animdl/venv/bin/animdl'
    dest: '{{ xdg_dir.bin_home }}/animdl'
    state: link
