- name: Install nextcloud-client
  community.general.pacman:
    name: nextcloud-client
    state: present

- name: Link homefolders to cloud
  ansible.builtin.file:
    src: "{{nextcloud_cloud_directory}}{{item}}"
    dest: "{{nextcloud_user_home_directory}}{{item}}"
    owner: "{{ users[desktop_username].username }}"
    group: "{{ users[desktop_username].username }}"
    state: link
    force: yes
  ignore_errors: true # Just temporary @todo remove
  loop:
    - Templates
    - Documents
    - Videos
    - Pictures
    - Music
    - Desktop
    - Software
    - Downloads
    - Workspaces
    - Books
    - Screenshots

- name: Link dump folder
  ansible.builtin.file:
    src: "{{nextcloud_cloud_directory}}InstantUpload"
    dest: "{{nextcloud_user_home_directory}}Dump"
    owner: "{{ users[desktop_username].username }}"
    group: "{{ users[desktop_username].username }}"
    state: link