From 269672faf1bbdd4b8a9df4cfdb6e0d666e30b09a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Wei=C3=9Fl?= Date: Wed, 18 Oct 2017 04:48:04 +0200 Subject: [PATCH] [cloud] Add CAA record type to route53 (#29178) The CAA record type is supported in Amazon Route 53 since Aug 21, 2017. Tested manually. - https://aws.amazon.com/about-aws/whats-new/2017/08/amazon-route-53-now-supports-caa-records/ - http://docs.aws.amazon.com/Route53/latest/DeveloperGuide/ResourceRecordTypes.html#CAAFormat - https://tools.ietf.org/html/rfc6844 --- lib/ansible/modules/cloud/amazon/route53.py | 15 +++++++++++++-- lib/ansible/modules/cloud/amazon/route53_facts.py | 4 ++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/lib/ansible/modules/cloud/amazon/route53.py b/lib/ansible/modules/cloud/amazon/route53.py index cc0f7b35bf9..12f7b2abb3a 100644 --- a/lib/ansible/modules/cloud/amazon/route53.py +++ b/lib/ansible/modules/cloud/amazon/route53.py @@ -49,7 +49,7 @@ options: description: - The type of DNS record to create required: true - choices: [ 'A', 'CNAME', 'MX', 'AAAA', 'TXT', 'PTR', 'SRV', 'SPF', 'NS', 'SOA' ] + choices: [ 'A', 'CNAME', 'MX', 'AAAA', 'TXT', 'PTR', 'SRV', 'SPF', 'CAA', 'NS', 'SOA' ] alias: description: - Indicates if this is an alias record. @@ -292,6 +292,17 @@ EXAMPLES = ''' weight: 100 health_check: "d994b780-3150-49fd-9205-356abdd42e75" +# Add a CAA record (RFC 6844): +- route53: + state: present + zone: example.com + record: example.com + type: CAA + value: + - 0 issue "ca.example.net" + - 0 issuewild ";" + - 0 iodef "mailto:security@example.com" + ''' import time @@ -398,7 +409,7 @@ def main(): hosted_zone_id=dict(required=False, default=None), record=dict(required=True), ttl=dict(required=False, type='int', default=3600), - type=dict(choices=['A', 'CNAME', 'MX', 'AAAA', 'TXT', 'PTR', 'SRV', 'SPF', 'NS', 'SOA'], required=True), + type=dict(choices=['A', 'CNAME', 'MX', 'AAAA', 'TXT', 'PTR', 'SRV', 'SPF', 'CAA', 'NS', 'SOA'], required=True), alias=dict(required=False, type='bool'), alias_hosted_zone_id=dict(required=False), alias_evaluate_target_health=dict(required=False, type='bool', default=False), diff --git a/lib/ansible/modules/cloud/amazon/route53_facts.py b/lib/ansible/modules/cloud/amazon/route53_facts.py index 2dd3bf0885d..fe846c1ccad 100644 --- a/lib/ansible/modules/cloud/amazon/route53_facts.py +++ b/lib/ansible/modules/cloud/amazon/route53_facts.py @@ -66,7 +66,7 @@ options: description: - The type of DNS record required: false - choices: [ 'A', 'CNAME', 'MX', 'AAAA', 'TXT', 'PTR', 'SRV', 'SPF', 'NS' ] + choices: [ 'A', 'CNAME', 'MX', 'AAAA', 'TXT', 'PTR', 'SRV', 'SPF', 'CAA', 'NS' ] dns_name: description: - The first name in the lexicographic ordering of domain names that you want @@ -388,7 +388,7 @@ def main(): delegation_set_id=dict(), start_record_name=dict(), type=dict(choices=[ - 'A', 'CNAME', 'MX', 'AAAA', 'TXT', 'PTR', 'SRV', 'SPF', 'NS' + 'A', 'CNAME', 'MX', 'AAAA', 'TXT', 'PTR', 'SRV', 'SPF', 'CAA', 'NS' ]), dns_name=dict(), resource_id=dict(type='list', aliases=['resource_ids']),