# AWS vpc creation problem on Mac OS X

**URL:** <https://forum.ansible.com/t/aws-vpc-creation-problem-on-mac-os-x/20267>\
**Category:** Ansible Project\
**Tags:** ubuntu, aws\
**Created:** [January 19, 2016, 8:21am UTC](https://forum.ansible.com/t/aws-vpc-creation-problem-on-mac-os-x/20267 "2016-01-19T08:21:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [January 19, 2016, 8:21am UTC](https://forum.ansible.com/t/aws-vpc-creation-problem-on-mac-os-x/20267/1 "2016-01-19T08:21:25Z")

</div>

Hi,

I have a problem while creating aws vpc from mac os x but the exact same command/role is working from ubuntu.

Steps that I have already taken on Mac OS X:

- update the time using ntp
- upgrade the ansible to version 2
- downgrade the ansible to version 1.9.1,1.9.2,1.9.3 and 1.9.4
- boto version is 2.38.0

With all above changes, I am getting this error:

ansible-playbook -i inventory/hosts aws.yml -vvvv  
Using /Users/arbab/ansible2/aws/ansible.cfg as config file  
1 plays in aws.yml

PLAY \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK [vpc : Creating an AWS VPC inside mentioned Region] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
task path: /Users/arbab/ansible2/aws/roles/vpc/tasks/main.yml:2  
ESTABLISH LOCAL CONNECTION FOR USER: arbabnazar  
127.0.0.1 EXEC ( umask 22 && mkdir -p “$( echo $HOME/.ansible/tmp/ansible-tmp-1453191395.76-205801730631196 )” && echo “$( echo $HOME/.ansible/tmp/ansible-tmp-1453191395.76-205801730631196 )” )  
127.0.0.1 PUT /var/folders/rq/yhlwx3c971x6p88qwmvhpg600000gn/T/tmpoyL88U TO /Users/arbab/.ansible/tmp/ansible-tmp-1453191395.76-205801730631196/ec2\_vpc  
127.0.0.1 EXEC LANG=en\_US.UTF-8 LC\_ALL=en\_US.UTF-8 LC\_MESSAGES=en\_US.UTF-8 /usr/bin/python /Users/arbab/.ansible/tmp/ansible-tmp-1453191395.76-205801730631196/ec2\_vpc; rm -rf “/Users/arbab/.ansible/tmp/ansible-tmp-1453191395.76-205801730631196/” \> /dev/null 2\>&1  
An exception occurred during task execution. The full traceback is:  
Traceback (most recent call last):  
File “/Users/arbab/.ansible/tmp/ansible-tmp-1453191395.76-205801730631196/ec2\_vpc”, line 2867, in   
main()  
File “/Users/arbab/.ansible/tmp/ansible-tmp-1453191395.76-205801730631196/ec2\_vpc”, line 700, in main  
(vpc\_dict, new\_vpc\_id, subnets\_changed, igw\_id, changed) = create\_vpc(module, vpc\_conn)  
File “/Users/arbab/.ansible/tmp/ansible-tmp-1453191395.76-205801730631196/ec2\_vpc”, line 338, in create\_vpc  
previous\_vpc = find\_vpc(module, vpc\_conn, id, cidr\_block)  
File “/Users/arbab/.ansible/tmp/ansible-tmp-1453191395.76-205801730631196/ec2\_vpc”, line 198, in find\_vpc  
previous\_vpcs = vpc\_conn.get\_all\_vpcs(None, {‘cidr’: cidr, ‘state’: ‘available’})  
File “/Library/Python/2.7/site-packages/boto/vpc/ **init**.py”, line 111, in get\_all\_vpcs  
return self.get\_list(‘DescribeVpcs’, params, [(‘item’, VPC)])  
File “/Library/Python/2.7/site-packages/boto/connection.py”, line 1186, in get\_list  
raise self.ResponseError(response.status, response.reason, body)  
boto.exception.EC2ResponseError: EC2ResponseError: 401 Unauthorized

\<?xml version="1.0" encoding="UTF-8"?\>

`AuthFailure`AWS was not able to validate the provided access credentials2318e170-a400-499c-8713-4c0b3ec1850d

fatal: [127.0.0.1]: FAILED! =\> {“changed”: false, “failed”: true, “invocation”: {“module\_name”: “ec2\_vpc”}, “parsed”: false}

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
127.0.0.1 : ok=0 changed=0 unreachable=0 failed=1

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [January 21, 2016, 5:06pm UTC](https://forum.ansible.com/t/aws-vpc-creation-problem-on-mac-os-x/20267/2 "2016-01-21T17:06:10Z")

</div>

@Brain, your valuable feedback here please?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [January 25, 2016, 4:53pm UTC](https://forum.ansible.com/t/aws-vpc-creation-problem-on-mac-os-x/20267/3 "2016-01-25T16:53:03Z")

</div>

I have figured out that there was an AWS credentials inside my environment which was not valid. I run the **env** command to find this.
