---

- name: Create the archive dir
  file: path={{ consul_tpl_root_dir }}/archives/{{ consul_tpl_current_version }} state=directory
  tags: consul,vault

- name: Backup previous version
  synchronize:
    src: "{{ consul_tpl_root_dir }}/{{ item }}"
    dest: "{{ consul_tpl_root_dir }}/archives/{{ consul_tpl_current_version }}/"
    compress: False
  delegate_to: "{{ inventory_hostname }}"
  loop:
    - bin
  tags: consul,vault

