-
Notifications
You must be signed in to change notification settings - Fork 398
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Route53 module fails with KeyError: DelegationSet #423
Comments
Files identified in the description:
If these files are inaccurate, please update the |
Hi @fridlik, The route53 module was just rewritten to use the boto3 library instead of the the old boto (v2) library. Unfortunately it looks like our integration tests didn't catch this. There is also a route53_info module. Would you be able to see if you can "get" what you needed with that module? While it's not been deprecated in the route53 module yet, "get" modes on modules is discouraged, so if possible we should be deprecating the "get" mode anyway. This is a bug that should be fixed, but it would be helpful to know if you can do what you need with route53_info in preparation for deprecating the "get" mode. CC: @pjrm |
@tremble Thank you for your response, I'll try to use route53_info module. I just need to retrieve the A record with the provided name and delete the record if it exists. I tried to debug the module and discovered one weird behavior: the problem is on this line: https://github.com/ansible-collections/community.aws/blob/main/plugins/modules/route53.py#L568, when I tried to print out the response from the rotue53.get_hosted_zone using module.fail_json(), I've got the following output:
It's weird, that the output does not contain |
If you don't need to store the existing record then it should be possible to skip the 'fetch' state and just set the record state to 'absent' The "changed" state returned would then tell you if it did anything or not.
|
tbh I had this solution in some previous version of my code, but I changed it, but don't remember why :) edit: here is the reason:
so I solved it using these commands:
|
* Fix state=get on route53 module This bug was introduced when refactoring from boto to boto3 library. This happens because the method "get_hosted_zone" only returns the DelegationSet when the DNS zone is external. Therefore this breaks when trying to get internal records. The solution is to search for getting DNS records of type ''NS'' with the same name as the hosted zone. * Update changelogs/fragments/406-route53-state-get.yml Co-authored-by: Mark Chappell <[email protected]>
…ble-collections#424) * Fix state=get on route53 module This bug was introduced when refactoring from boto to boto3 library. This happens because the method "get_hosted_zone" only returns the DelegationSet when the DNS zone is external. Therefore this breaks when trying to get internal records. The solution is to search for getting DNS records of type ''NS'' with the same name as the hosted zone. * Update changelogs/fragments/406-route53-state-get.yml Co-authored-by: Mark Chappell <[email protected]>
…ble-collections#424) * Fix state=get on route53 module This bug was introduced when refactoring from boto to boto3 library. This happens because the method "get_hosted_zone" only returns the DelegationSet when the DNS zone is external. Therefore this breaks when trying to get internal records. The solution is to search for getting DNS records of type ''NS'' with the same name as the hosted zone. * Update changelogs/fragments/406-route53-state-get.yml Co-authored-by: Mark Chappell <[email protected]>
…ble-collections#424) * Fix state=get on route53 module This bug was introduced when refactoring from boto to boto3 library. This happens because the method "get_hosted_zone" only returns the DelegationSet when the DNS zone is external. Therefore this breaks when trying to get internal records. The solution is to search for getting DNS records of type ''NS'' with the same name as the hosted zone. * Update changelogs/fragments/406-route53-state-get.yml Co-authored-by: Mark Chappell <[email protected]>
…ble-collections#424) * Fix state=get on route53 module This bug was introduced when refactoring from boto to boto3 library. This happens because the method "get_hosted_zone" only returns the DelegationSet when the DNS zone is external. Therefore this breaks when trying to get internal records. The solution is to search for getting DNS records of type ''NS'' with the same name as the hosted zone. * Update changelogs/fragments/406-route53-state-get.yml Co-authored-by: Mark Chappell <[email protected]>
…_route_table Promote ec2 vpc route table SUMMARY Migrate ec2_vpc_route_table* modules and tests ISSUE TYPE Feature Pull Request COMPONENT NAME ec2_vpc_route_table, ec2_vpc_route_table_info Depends-On: ansible/ansible-zuul-jobs/pull/1014 Reviewed-by: Mark Chappell <None> Reviewed-by: None <None>
…ble-collections#424) * Fix state=get on route53 module This bug was introduced when refactoring from boto to boto3 library. This happens because the method "get_hosted_zone" only returns the DelegationSet when the DNS zone is external. Therefore this breaks when trying to get internal records. The solution is to search for getting DNS records of type ''NS'' with the same name as the hosted zone. * Update changelogs/fragments/406-route53-state-get.yml Co-authored-by: Mark Chappell <[email protected]> This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections@331ada1
SUMMARY
The module route53 fails when retrieving the DNS record. The affected version is the latest release (1.4.0), it works with
community.aws==1.3.0
. The dependent libraryamazon.aws
is on 1.4.0 version (amazon.aws==1.4.0
andcommunity.aws==1.3.0
works).Stacktrace:
ISSUE TYPE
COMPONENT NAME
route53
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
running host: MacOS BigSur 11.2.1
STEPS TO REPRODUCE
Run the ansible configuration below:
EXPECTED RESULTS
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: