---

# Detect installed version (if any)
- block:
    - import_tasks: ../includes/webapps_set_install_mode.yml
      vars:
        - root_dir: "{{ es_root_dir }}"
        - version: "{{ es_version }}"
    - set_fact: es_install_mode={{ (install_mode == 'upgrade' and not es_manage_upgrade) | ternary('none',install_mode) }}
    - set_fact: es_current_version={{ current_version | default('') }}
  tags: es

- name: Check if Seafile is installed
  stat: path={{ seafile_root_dir | default('/opt/seafile') }}/seafile-server/pro/elasticsearch/
  register: es_seafile_bundled_es
  tags: es

- name: Check if seafile is installed
  stat: path=/etc/systemd/system/seafile.service
  register: es_seafile_service
  tags: es
