I'm archiving a file and then transferring it to s3:
- name: Compress a directory
archive:
path: "local/usr/directory"
dest: "local/user/directory.tgz"
register: registered_directory
- name: Transfer archived directory to s3
aws_s3:
bucket: "{{ bucket }}"
object: "{{ bucket_folder }}/directory.tgz"
src: "{{ registered_directory.dest }}"
mode: put
region: "{{ aws_region }}"
This is only running as a dry run, and there is a requirement where the dry run needs to run successfully to be able to do the actual build. But, the dry run fails in the second step (transferring to s3) with the following error:
"msg": "Local object for PUT does not exist"
I'm aware that the actual physical tgz object doesn't exist in this point in time since this is only a dry run and the first task isn't actually being executed. I'm looking for some way for the second task to recognize that it is using the output from the first task to grab the tar file. Any way to set this dependency?