Delete an object/file from an s3 bucket

0 votes
How do I write a playbook/task to delete a file from an S3 bucket?
Jul 31 in Ansible by Jinu
14 views

1 answer to this question.

0 votes
Hey @Jinu, you can try the following ansible task:

---
- hosts: localhost
  become: true
  tasks:
  - name: Delete an S3 bucket
    aws_s3: aws_access_key=<AccessKey> aws_secret_key=<Secret Key> bucket=example object=/development/example.txt mode=delobj
answered Jul 31 by Barbara

Related Questions In Ansible

+1 vote
1 answer

Ansible: Deleting matching IPs from hosts file using regex

Ansible notation isn't the same as YAML ...READ MORE

answered Jul 25, 2018 in Ansible by DareDev
• 6,810 points
226 views
0 votes
1 answer

Set an explicit inventory file - Kubespray

Hi @Isha, Go to /etc/ansible/ansible.cfg In the default section ...READ MORE

answered Jan 23 in Ansible by Yesha
41 views
0 votes
1 answer
0 votes
1 answer

Encrypt an encrypted file - Ansible Vault

Hey @Fez, This is one of the way ...READ MORE

answered Jan 29 in Ansible by Cerci
49 views
0 votes
1 answer

Ansible task to copy file to S3 bucket

Hey @Adarsh, try this task definition: --- - hosts: ...READ MORE

answered Jul 31 in Ansible by Vish
14 views