--- - name: Create the archive dir file: path: "{{ appsmith_root_dir }}/archives/{{ appsmith_current_version }}" state: directory tags: appsmith - name: Archive previous version synchronize: src: "{{ appsmith_root_dir }}/{{ item }}" dest: "{{ appsmith_root_dir }}/archives/{{ appsmith_current_version }}" recursive: True delete: True loop: - server - client - etc - meta delegate_to: "{{ inventory_hostname }}" tags: appsmith - name: Dump mongo database command: mongodump --uri {{ appsmith_mongo_url }} --out {{ appsmith_root_dir }}/archives/{{ appsmith_current_version }}/ tags: appsmith