---

- name: Checkout Prosody Auth Matrix User Verification Plugin Repo
  ansible.builtin.git:
    repo: "{{ matrix_jitsi_prosody_auth_matrix_user_verification_repo_location }}"
    dest: "{{ matrix_jitsi_prosody_auth_matrix_user_verification_repo_target }}"
    version: "{{ matrix_jitsi_prosody_auth_matrix_user_verification_repo_version }}"
  become: true
  become_user: "{{ matrix_user_username }}"

- name: Install Prosody Auth Matrix User Verification Plugin
  ansible.builtin.copy:
    remote_src: true
    src: "{{ matrix_jitsi_prosody_auth_matrix_user_verification_repo_target }}/{{ item.path }}"
    dest: "{{ matrix_jitsi_prosody_plugins_path }}/{{ item.path }}"
    mode: 0644
    owner: "{{ matrix_user_username }}"
    group: "{{ matrix_user_groupname }}"
  with_items: "{{ matrix_jitsi_prosody_auth_matrix_files }}"
  when: item.when | bool
