--- - name: Create archives of the monorepository shell: | (git ls-tree -r HEAD --name-only | sed '/^contracts$/d') | xargs tar zcfv monorepo.tar.gz --files-from - cd contracts; (git ls-tree -r HEAD --name-only) | xargs tar zcfv ../contracts.tar.gz --files-from - delegate_to: 127.0.0.1 become: false args: chdir: "{{ lookup('env', 'PWD') }}/.." - name: Copy the archives copy: src: ../../../../{{ item }} dest: "{{ bridge_path }}/" with_items: - monorepo.tar.gz - contracts.tar.gz - name: Untar the archives shell: | tar zxfv monorepo.tar.gz && rm monorepo.tar.gz mkdir -p contracts && tar zxfv contracts.tar.gz -C ./contracts && rm contracts.tar.gz args: chdir: "{{ bridge_path }}" - name: Remove local archives shell: rm {{ item }} delegate_to: 127.0.0.1 become: false args: chdir: "{{ lookup('env', 'PWD') }}/.." with_items: - monorepo.tar.gz - contracts.tar.gz