- hosts: all tasks: - name: make directory for gz files shell: "mkdir -p /data/backups_app" - name: rsync deploy file copy: src={{ source }} dest=/data/backups_app/{{ source }} - name: decomp file #shell: cd /data/backups_app/ && mkdir -p {{ tag }} shell: "cd /data/backups_app/ && mkdir -p {{ desc_path }} && tar zxvf {{ source }} -C {{ desc_path }} && chown -R {{ user }}. {{ desc_path }}" - name: create symbolic shell: "cd {{ paths }} && rm -f {{ name }} && ln -s /data/backups_app/{{ tag }} {{ name }}" - name: restart service shell: "su {{ user }} -c 'cd /data/apps/{{ paths }}/{{ name }} && {{ start_script }}'"