# s3\_website module fails as non-root on MacOS

**URL:** <https://forum.ansible.com/t/s3-website-module-fails-as-non-root-on-macos/27505>\
**Category:** Ansible Developer\
**Tags:** aws\
**Created:** [May 10, 2018, 2:23pm UTC](https://forum.ansible.com/t/s3-website-module-fails-as-non-root-on-macos/27505 "2018-05-10T14:23:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bernd\_Prager](https://avatars.discourse-cdn.com/v4/letter/b/bb73d2/32.png) [@Bernd\_Prager](https://forum.ansible.com/u/Bernd_Prager)\
**Post date:** [May 10, 2018, 2:23pm UTC](https://forum.ansible.com/t/s3-website-module-fails-as-non-root-on-macos/27505/1 "2018-05-10T14:23:21Z")

</div>

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
