--- - hosts: "{{ deploy_hosts }}" remote_user: ubuntu tasks: - name: copy shell copy: src: ../deploy/cleanup.sh dest: /jxdata/jx-callback/cleanup.sh owner: ubuntu group: ubuntu mode: 0777 - name: cleanup previous backup files shell: cd /jxdata/jx-callback && ./cleanup.sh - name: copy execute file to dest copy: src: ../jx-callback dest: /jxdata/jx-callback/jx-callback owner: ubuntu group: ubuntu mode: 0755 backup: yes - name: copy conf file to dest copy: src: ../conf/app.conf dest: /jxdata/jx-callback/conf/app.conf owner: ubuntu group: ubuntu mode: 0555 - name: shell shell: cd /jxdata/jx-callback/conf && sed -i 's/runmode\s*=\s*.*/runmode = {{ runmode }}/' app.conf && sudo systemctl restart jx-callback