diff options
author | mansunkuo <coccolegacy@gmail.com> | 2016-06-06 15:51:25 -0500 |
---|---|---|
committer | René Moser <mail@renemoser.net> | 2016-06-06 22:51:25 +0200 |
commit | 91e9223a763bf5aa6515f02e377b38c7b5be2072 (patch) | |
tree | 99fe69535338f8549c3e41c5c889d567d1a4a77a | |
parent | 64482042717dfdb3dae50a8cc5a862725b878de8 (diff) | |
download | ansible-modules-core-91e9223a763bf5aa6515f02e377b38c7b5be2072.tar.gz |
Add an example to delete Route53 alias record set (#3834)
-rw-r--r-- | cloud/amazon/route53.py | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/cloud/amazon/route53.py b/cloud/amazon/route53.py index 5141a0d7..107ca757 100644 --- a/cloud/amazon/route53.py +++ b/cloud/amazon/route53.py @@ -95,7 +95,7 @@ options: description: - Have to be specified for Weighted, latency-based and failover resource record sets only. An identifier that differentiates among multiple resource record sets that have the - same combination of DNS name and type. + same combination of DNS name and type. required: false default: null version_added: "2.0" @@ -194,7 +194,7 @@ EXAMPLES = ''' type: "AAAA" ttl: "7200" value: "::1" - + # Add a SRV record with multiple fields for a service on port 22222 # For more information on SRV records see: # https://en.wikipedia.org/wiki/SRV_record @@ -225,6 +225,25 @@ EXAMPLES = ''' alias=True alias_hosted_zone_id="{{ elb_zone_id }}" +# Retrieve the details for elb.foo.com +- route53: + command: get + zone: foo.com + record: elb.foo.com + type: A + register: rec + +# Delete an alias record using the results from the get command +- route53: + command: delete + zone: foo.com + record: "{{ rec.set.record }}" + ttl: "{{ rec.set.ttl }}" + type: "{{ rec.set.type }}" + value: "{{ rec.set.value }}" + alias: True + alias_hosted_zone_id: "{{ rec.set.alias_hosted_zone_id }}" + # Add an alias record that points to an Amazon ELB and evaluates it health: - route53: command=create @@ -556,7 +575,7 @@ def main(): txt = txt.split("</Message>")[0] if "but it already exists" in txt: module.exit_json(changed=False) - else: + else: module.fail_json(msg = txt) except TimeoutError: module.fail_json(msg='Timeout waiting for changes to replicate') |