From b3e84f2dd42afbc35cd0ed349320d5fb4f3ab2ec Mon Sep 17 00:00:00 2001 From: Phillip Holmes Date: Mon, 29 Sep 2014 16:20:25 -0500 Subject: [PATCH 1/2] Route53 fix - forcing zone_in, record_in to lower case It turns out the Route53 API cares if the zone and record specified in the playbook are lower case or not when deleting a record. If you use a variable to name your servers and care about case, using that same proper case name will cause Route53 DNS delete requests to fail. The change requested adds .lower() to the module.params.get for both zone and record when used in the underlying code. Both zone and record are mandatory variables, and as such a more complicated implementation is not needed, as they must always be specified when using this module see lines 169 and 170 for the required state). If you use lowercase names (or don't use a name variable and share it between a tag and DNS entries) then you will never see this issue. Tested/Confirmed as an issue in Ansible 1.6.6 and above. --- cloud/route53.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cloud/route53.py b/cloud/route53.py index b3878e0580e..d0723a3d0e6 100644 --- a/cloud/route53.py +++ b/cloud/route53.py @@ -178,9 +178,9 @@ def main(): module = AnsibleModule(argument_spec=argument_spec) command_in = module.params.get('command') - zone_in = module.params.get('zone') + zone_in = module.params.get('zone').tolower ttl_in = module.params.get('ttl') - record_in = module.params.get('record') + record_in = module.params.get('record').tolower type_in = module.params.get('type') value_in = module.params.get('value') retry_interval_in = module.params.get('retry_interval') From 7402827950b873d35ff7d25174e57d71bff5c598 Mon Sep 17 00:00:00 2001 From: Phillip Holmes Date: Mon, 29 Sep 2014 16:23:41 -0500 Subject: [PATCH 2/2] Route53 fix - forcing zone_in, record_in to lower case Fixed the .tolower to .lower() for correct syntax (copied change from older notes). --- cloud/route53.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cloud/route53.py b/cloud/route53.py index d0723a3d0e6..0d7fdcbade5 100644 --- a/cloud/route53.py +++ b/cloud/route53.py @@ -178,9 +178,9 @@ def main(): module = AnsibleModule(argument_spec=argument_spec) command_in = module.params.get('command') - zone_in = module.params.get('zone').tolower + zone_in = module.params.get('zone').lower() ttl_in = module.params.get('ttl') - record_in = module.params.get('record').tolower + record_in = module.params.get('record').lower() type_in = module.params.get('type') value_in = module.params.get('value') retry_interval_in = module.params.get('retry_interval')