---

- name: Remove tmp and obsolete files
  file: path={{ item }} state=absent
  loop:
    - "{{ pgweb_root_dir }}/tmp/pgweb_linux_amd64"
    - "{{ pgweb_root_dir }}/tmp/pgweb_linux_amd64.zip"
  tags: pgweb,pg

- name: Remove temp previous version dir
  file: path={{ pgweb_root_dir }}/archives/{{ pgweb_current_version }} state=absent
  when: pgweb_install_mode == 'upgrade'
  tags: pgweb,pg
