s3_website module fails as non-root on MacOS

Hi,

I am trying to configure an existing S3 bucket as a website bucket.
My playbook contains 2 simple tasks straight from the example page:

tasks:

  • name: Create AWS S3
    s3_bucket:
    name: bernd-blue
    region: ap-southeast-1
    aws_access_key: “{{ AWS_ACCESS_KEY_ID }}”
    aws_secret_key: “{{ AWS_SECRET_ACCESS_KEY }}”
  • name: Configure bucket as a website
    s3_website:
    name: bernd-blue
    region: ap-southeast-1
    state: present
    aws_access_key: “{{ AWS_ACCESS_KEY_ID }}”
    aws_secret_key: “{{ AWS_SECRET_ACCESS_KEY }}”


The first task executes successfully, while the second one fails with:

The full traceback is:
Traceback (most recent call last):
File “/var/folders/10/shggjfls4mv_3g4xq3rb3pnm0000gn/T/ansible_67vv1fmw/ansible_module_s3_website.py”, line 212, in enable_or_update_bucket_as_website
website_config = client_connection.get_bucket_website(Bucket=bucket_name)
File “/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/botocore/client.py”, line 314, in _api_call
return self._make_api_call(operation_name, kwargs)
File “/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/botocore/client.py”, line 612, in _make_api_call
raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred () when calling the GetBucketWebsite operation:


If I run ansible-playbook with ‘sudo’ it succeeds.

Does anybody encountered that error as well?
What do I have to do to fix that?

Thank you for any help.
– Bernd