Skip to content

Commit

Permalink
Merge pull request IQSS#164 from GlobalDataverseCommunityConsortium/1…
Browse files Browse the repository at this point in the history
…63_cors_bypass

allow cors step bypass
  • Loading branch information
donsizemore authored Jul 28, 2021
2 parents 0660fd2 + 429253e commit 944640c
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ s3:
access_key: 4cc355_k3y
secret_access_key: s3cr3t_4cc355_k3y
bucket_name: s3-test
cors_already_set: false
create_bucket: true
# for non-amazon services. for localstack, you might set
#custom_endpoint_url: "http://localhost:4572"
Expand Down
8 changes: 4 additions & 4 deletions tasks/s3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@
owner: '{{ dataverse.payara.user }}'
group: '{{ dataverse.payara.group }}'
mode: 0644
when: s3.download_redirect == true or
s3.upload_redirect == true
when: (s3.download_redirect == true or s3.upload_redirect == true)
and s3.cors_already_set == false

- name: enable CORS on S3 bucket
shell:
Expand All @@ -89,9 +89,9 @@
become_user: '{{ dataverse.payara.user }}'
environment:
PATH: "{{ lookup('env', 'PATH') }}:/usr/local/bin"
when: (s3.download_redirect == true or
s3.upload_redirect == true)
when: (s3.download_redirect == true or s3.upload_redirect == true)
and custom_endpoint_url | length == 0
and s3.cors_already_set == false

- include: s3_custom_endpoint_url.yml
when: custom_endpoint_url | length > 0
Expand Down
1 change: 1 addition & 0 deletions tests/group_vars/jenkins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ s3:
access_key: 4cc355_k3y
secret_access_key: s3cr3t_4cc355_k3y
bucket_name: s3-test
cors_already_set: false
create_bucket: true
# for non-amazon services.
custom_endpoint_url: "http://localhost:4572"
Expand Down
1 change: 1 addition & 0 deletions tests/group_vars/memorytests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ s3:
access_key: 4cc355_k3y
secret_access_key: s3cr3t_4cc355_k3y
bucket_name: s3-test
cors_already_set: false
create_bucket: true
# for non-amazon services.
custom_endpoint_url: "http://localhost:4572"
Expand Down
1 change: 1 addition & 0 deletions tests/group_vars/vagrant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ s3:
secret_access_key: s3cr3t_4cc355_k3y
bucket_name: s3-test
create_bucket: true
cors_already_set: false
# for non-amazon services. for localstack, you might set
#custom_endpoint_url: "http://localhost:4572"
custom_endpoint_url:
Expand Down

0 comments on commit 944640c

Please sign in to comment.