---
- name: Clone dotfiles repository
  git:
    repo: "{{ dotfiles_remote }}"
    dest: "{{ dotfiles_git_dir }}"
    update: yes

- name: Create symlinks to dotfiles in .config
  file:
    src: "{{ dotfiles_git_dir }}/.config/{{ item }}"
    dest: "{{ home }}/.config/{{ item }}"
    state: link
  loop: "{{ config_dotfiles }}"

- name: Create symlinks to dotfiles in $HOME
  file:
    src: "{{ dotfiles_git_dir }}/{{ item }}"
    dest: "{{ home }}/{{ item }}"
    state: link
  loop: "{{ home_dotfiles }}"
