diff options
Diffstat (limited to 'tasks/copy-rendered-templates-recursive.yml')
| -rw-r--r-- | tasks/copy-rendered-templates-recursive.yml | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/tasks/copy-rendered-templates-recursive.yml b/tasks/copy-rendered-templates-recursive.yml index e3311df..b933d0a 100644 --- a/tasks/copy-rendered-templates-recursive.yml +++ b/tasks/copy-rendered-templates-recursive.yml @@ -75,12 +75,13 @@ delegate_to: localhost become: false ansible.builtin.command: - cmd: tar -czf {{ tempdir.path }}/rendered-files.tar.gz -C {{ tempdir.path }} . - creates: "{{ tempdir.path }}/rendered-files.tar.gz" + cmd: tar -czf /tmp/rendered-files-{{ tempdir.path | basename }}.tar.gz -C {{ tempdir.path }} . + register: tar_result + changed_when: tar_result.rc == 0 - name: Transfer tarball to remote host ansible.builtin.copy: - src: "{{ tempdir.path }}/rendered-files.tar.gz" + src: "/tmp/rendered-files-{{ tempdir.path | basename }}.tar.gz" dest: "/tmp/rendered-files.tar.gz" mode: '0644' @@ -106,6 +107,13 @@ path: "/tmp/rendered-files.tar.gz" state: absent +- name: Remove local tarball + delegate_to: localhost + become: false + ansible.builtin.file: + path: "/tmp/rendered-files-{{ tempdir.path | basename }}.tar.gz" + state: absent + - name: Remove local temporary directory delegate_to: localhost become: false |
