---
- name: Install rcm
  kewlfft.aur.aur:
    name: rcm
  become: yes
  become_user: "{{ aur.user }}"
  when: dotfiles is defined
  tags:
    - aur

- name: Clone user dotfiles
  git:
    repo: "{{ dotfiles.url }}"
    dest: /home/{{ user.name }}/{{ dotfiles.destination }}
    accept_hostkey: yes
    update: no
  when: dotfiles is defined
  become: yes
  become_user: "{{ user.name }}"

- name: Install user dotfiles
  command: rcup -d /home/{{ user.name}}/{{ dotfiles.destination}} {{ dotfiles.rcup_flags }}
  when: dotfiles is defined
  become: yes
  become_user: "{{ user.name }}"
