uninstall_s3.yml 661 B

1234567891011121314151617181920212223242526
  1. ---
  2. - name: empty S3 bucket
  3. block:
  4. - name: get S3 object list
  5. aws_s3:
  6. bucket: "{{ openshift_aws_s3_bucket_name }}"
  7. mode: list
  8. region: "{{ openshift_aws_region }}"
  9. register: s3_out
  10. - name: delete S3 objects
  11. aws_s3:
  12. bucket: "{{ openshift_aws_s3_bucket_name }}"
  13. mode: delobj
  14. object: "{{ item }}"
  15. with_items: "{{ s3_out.s3_keys }}"
  16. when: openshift_aws_create_s3 | bool
  17. - name: delete S3 bucket
  18. aws_s3:
  19. bucket: "{{ openshift_aws_s3_bucket_name }}"
  20. mode: delete
  21. region: "{{ openshift_aws_region }}"
  22. when:
  23. - openshift_aws_create_s3 | bool
  24. - openshift_aws_really_delete_s3_bucket | bool