# Updating existing route tables

**URL:** <https://forum.ansible.com/t/updating-existing-route-tables/21959>\
**Category:** Ansible Project\
**Created:** [July 8, 2016, 9:49am UTC](https://forum.ansible.com/t/updating-existing-route-tables/21959 "2016-07-08T09:49:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prashant\_Bhosale](https://avatars.discourse-cdn.com/v4/letter/p/fbc32d/32.png) [@Prashant\_Bhosale](https://forum.ansible.com/u/Prashant_Bhosale)\
**Post date:** [July 8, 2016, 9:49am UTC](https://forum.ansible.com/t/updating-existing-route-tables/21959/1 "2016-07-08T09:49:08Z")

</div>

I have successfully created a VPC B and now I want to peer VPC B and VPC A.

In VPC B I can add the vpc\_peering id in route table, but struggling with how to update the route table of VPC A with the vpc\_peering id.

Tried using below play:

> * * *
> 
> - hosts: localhost  
> connection: local  
> gather\_facts: no  
> tasks:
> - name: update route table of VPC A  
> ec2\_vpc\_route\_table:  
> vpc\_id: vpc-5becdjn87  
> region: us-east-1  
> state: present  
> propagating\_vgw\_ids: yes  
> tags:  
> Name: test-update-rt  
> routes:
> - dest: 10.104.0.0/16  
> vpc\_peering\_connection\_id: pcx-e67hdo5h

But getting error as:

> fatal: [localhost]: FAILED! =\> {“changed”: false, “failed”: true, “invocation”: {“module\_name”: “ec2\_vpc\_route\_table”}, “module\_stderr”: “Traceback (most recent call last):\n File "/tmp/ansible\_dbLJB5/ansible\_module\_ec2\_vpc\_route\_table.py", line 611, in \n main()\n File "/tmp/ansible\_dbLJB5/ansible\_module\_ec2\_vpc\_route\_table.py", line 599, in main\n result = ensure\_route\_table\_present(connection, module)\n File "/tmp/ansible\_dbLJB5/ansible\_module\_ec2\_vpc\_route\_table.py", line 530, in ensure\_route\_table\_present\n check\_mode=module.check\_mode)\n File "/tmp/ansible\_dbLJB5/ansible\_module\_ec2\_vpc\_route\_table.py", line 408, in ensure\_propagation\n dry\_run=check\_mode)\n File "/usr/lib/python2.7/dist-packages/boto/vpc/ **init**.py", line 1492, in enable\_vgw\_route\_propagation\n return self.get\_status(‘EnableVgwRoutePropagation’, params)\n File "/usr/lib/python2.7/dist-packages/boto/connection.py", line 1227, in get\_status\n raise self.ResponseError(response.status, response.reason, body)\nboto.exception.EC2ResponseError: EC2ResponseError: 400 Bad Request\n\<?xml version=\"1.0\" encoding=\"UTF-8\"?\>\n`Gateway.NotAttached`resource true16a7e21a-07ca-4fcc-9678-50fdf3a12ee0\n”, “module\_stdout”: “”, “msg”: “MODULE FAILURE”, “parsed”: false}

Could anyone please help me on this.
