---

- name: Compress previous version
  command: tar cf {{ diagrams_root_dir }}/archives/{{ diagrams_current_version }}.tar.zst --use-compress-program=zstd ./
  environment:
    ZST_CLEVEL: 10
  args:
    chdir: "{{ diagrams_root_dir }}/archives/{{ diagrams_current_version }}"
    warn: False
  tags: diagrams

- name: Remove the archive directory
  file: path={{ diagrams_root_dir }}/archives/{{ diagrams_current_version }} state=absent
  tags: diagrams
