---

- name: Create the archive dir
  file: path={{ es_root_dir }}/archives/{{ es_current_version }} state=directory
  tags: es

- name: Archive current version
  synchronize:
    src: "{{ es_root_dir }}/app"
    dest: "{{ es_root_dir }}/archives/{{ es_current_version }}/"
    compress: False
    delete: True
  delegate_to: "{{ inventory_hostname }}"
  tags: es

