---

- name: Remove tmp and unused files
  file: path={{ item }} state=absent
  loop:
    - "{{ metabase_root_dir }}/tmp/metabase.jar"
    - "{{ metabase_root_dir }}/tmp/metabase-{{ metabase_version }}.tar.gz"
    - "{{ metabase_root_dir }}/tmp/metabase-{{ metabase_version }}"
  tags: metabase

- name: Remove archive tmp dir
  file: path={{ metabase_root_dir }}/archives/{{ metabase_current_version }} state=absent
  when: metabase_install_mode == 'upgrade'
  tags: metabase
