From 312155a64131b7192c889eee33b049bda1408685 Mon Sep 17 00:00:00 2001 From: David Kretch Date: Tue, 31 Oct 2017 22:34:34 -0400 Subject: [PATCH] Add ec2_vpc_route_table example, fix typo (#32415) * Add an example in the `ec2_vpc_route_table` module of deleting a route table. * Fix a typo in the AWS development guidelines, from `fail_json.aws()` to `fail_json_aws()`. --- lib/ansible/modules/cloud/amazon/GUIDELINES.md | 2 +- lib/ansible/modules/cloud/amazon/ec2_vpc_route_table.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/cloud/amazon/GUIDELINES.md b/lib/ansible/modules/cloud/amazon/GUIDELINES.md index 9834cb10ab7..45b59be34a4 100644 --- a/lib/ansible/modules/cloud/amazon/GUIDELINES.md +++ b/lib/ansible/modules/cloud/amazon/GUIDELINES.md @@ -198,7 +198,7 @@ _fail_json_aws() is a new method and may be subject to change. You can use it i being contributed back to Ansible, however if you are publishing your module separately please don't use it before the start of 2018 / Ansible 2.4_ -In the AnsibleAWSModule there is a special method, `module.fail_json.aws()` for nice reporting of +In the AnsibleAWSModule there is a special method, `module.fail_json_aws()` for nice reporting of exceptions. Call this on your exception and it will report the error together with a traceback for use in Ansible verbose mode. diff --git a/lib/ansible/modules/cloud/amazon/ec2_vpc_route_table.py b/lib/ansible/modules/cloud/amazon/ec2_vpc_route_table.py index 6517e9d4c4c..fc1a357534c 100644 --- a/lib/ansible/modules/cloud/amazon/ec2_vpc_route_table.py +++ b/lib/ansible/modules/cloud/amazon/ec2_vpc_route_table.py @@ -128,6 +128,13 @@ EXAMPLES = ''' instance_id: "{{ nat.instance_id }}" register: nat_route_table +- name: delete route table + ec2_vpc_route_table: + vpc_id: vpc-1245678 + region: us-west-1 + route_table_id: "{{ route_table.id }}" + lookup: id + state: absent ''' import re