Skip to content

Commit

Permalink
#387 wait until localstack is ready (#388)
Browse files Browse the repository at this point in the history
Co-authored-by: Don Sizemore <[email protected]>
  • Loading branch information
donsizemore and Don Sizemore authored Dec 18, 2024
1 parent b1e056c commit 1e6a6f1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tasks/localstack_create_bucket.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@
ansible.builtin.set_fact: "custom_endpoint_escaped={{ bucket_options.custom_endpoint_url | regex_replace (':','\\:') }}"
when: bucket_options.custom_endpoint_url | length > 0

- name: Wait until localstack status is ready
uri:
url: '{{ bucket_options.custom_endpoint_url }}'
return_content: yes
validate_certs: no
status_code:
- 200
until: uri_output.status == 200
retries: 18 # 18 retries * 10 seconds == 3 minutes
delay: 10
register: uri_output

- name: create localstack bucket for testing
ansible.builtin.shell: "aws --endpoint={{ custom_endpoint_escaped }} s3 mb s3://{{ bucket_options.bucket_name }}"
become: yes
Expand Down

0 comments on commit 1e6a6f1

Please sign in to comment.