Ansible playbook to delete multiple S3 buckets

0 votes
How do I write an andible playbook to delete multiple s3 buckets? Do I need to use different tasks for each s3 delete?
Aug 30 in Ansible by Hari
42 views

1 answer to this question.

0 votes

Hey @Hari, you can use the following playbook for deleting multiple s3 buckets. One of the way of achieving this is by using seperate tasks for each delete task. I am not very sure if this is efficient but it works.

---
hosts: localhost
  gather_facts: no
  connection: local
  vars_files:
   - aws-creds.yml
  tasks:
  - name: To Delete S3 Bucket
    aws_s3:
      bucket: bucket01
      mode: delete
  - name: To Delete S3 Bucket
    aws_s3:
      bucket: bucket02
      mode: delete
  - name: To Delete S3 Bucket
    aws_s3:
      bucket: bucket03
      mode: delete
answered Aug 30 by Chris

Related Questions In Ansible

0 votes
1 answer

How do i set multiple authorized keys to my ansible playbook?

Try this: - name: Set up multiple authorized ...READ MORE

answered Feb 11 in Ansible by John
66 views
0 votes
1 answer

Running ansible command on a single server when it is deployed to multiple servers

You can try the run_once attribute: Example from ...READ MORE

answered Jun 13, 2018 in Ansible by DareDev
• 6,810 points
193 views
0 votes
1 answer

devops , how to create user using ansible playbook

root doesn't need a password to switch ...READ MORE

answered Jul 16, 2018 in Ansible by Kalgi
• 2,620 points
124 views
0 votes
1 answer

ansible playbook: using multiple variables in loops

Use an indexed hostname, and then define ...READ MORE

answered Jul 16, 2018 in Ansible by DareDev
• 6,810 points
4,844 views
0 votes
1 answer