Create a playbook to copy local directory to s3 bucket

155 views
Skip to first unread message

Sumit Debnath

unread,
Nov 22, 2021, 9:01:22 AM11/22/21
to Ansible Project
I have some directory which i want to copy on s3 bucket using aws s3 module ansible i have tried this 

aws_s3:
          aws_secret_key: "{{ AWS_SECRET_KEY }}"
          aws_access_key: "{{ AWS_ACCESS_KEY }}"
          bucket: "{{ BUCKET }}"
          object: /project/
          src: "{{ role_path }}/files/server-upgrade/"
          mode: put

but i am getting error 

fatal: [localhost]: FAILED! => {"changed": false, "msg": "Local object for PUT does not exist"}

Luca 'remix_tj' Lorenzetto

unread,
Nov 23, 2021, 4:14:49 AM11/23/21
to ansible...@googlegroups.com
Hello,
aws_s3 module doesn't upload an entire directory, but only single files.

Luca


--
"E' assurdo impiegare gli uomini di intelligenza eccellente per fare
calcoli che potrebbero essere affidati a chiunque se si usassero delle
macchine"
Gottfried Wilhelm von Leibnitz, Filosofo e Matematico (1646-1716)

"Internet è la più grande biblioteca del mondo.
Ma il problema è che i libri sono tutti sparsi sul pavimento"
John Allen Paulos, Matematico (1945-vivente)

Luca 'remix_tj' Lorenzetto, http://www.remixtj.net , <lorenze...@gmail.com>
Reply all
Reply to author
Forward
0 new messages