---
- name: Create a archive of min directory
  community.general.archive:
    path: "{{ sq_frontend_dir }}/userapp/static/min"
    dest: "{{ sq_frontend_dir }}/userapp/static/min.tgz"
    owner: root
    group: root
    mode: "0755"

- name: Copy custom-frontend.tar.gz to the target destination
  ansible.builtin.copy:
    src: ../../../assets/custom-frontend.tar.gz
    dest: "{{ sq_frontend_dir }}/userapp/static/custom-frontend.tar.gz"
    owner: root
    group: root
    mode: "0755"

- name: Extract custom-frontend.tar.gz # noqa: command-instead-of-module
  ansible.builtin.shell: |
    tar -xzf custom-frontend.tar.gz --overwrite
  args:
    chdir: "{{ sq_frontend_dir }}/userapp/static"
  changed_when: true
  notify: Restart sqfrontendd
