--- - name: Create archive dir file: path={{ graylog_root_dir }}/archives/{{ graylog_current_version }}/mongo state=directory tags: graylog - name: Archive current version synchronize: src: "{{ graylog_root_dir }}/app" dest: "{{ graylog_root_dir }}/archives/{{ graylog_current_version }}/" recursive: True delete: True delegate_to: "{{ inventory_hostname }}" tags: graylog - name: Archive mongo database command: mongodump --quiet --out {{ graylog_root_dir }}/archives/{{ graylog_current_version }}/mongo --uri {{ graylog_mongo_url[0] }} tags: graylog