mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-10 19:21:31 -07:00
route53_zone: return existing zone id in check mode (#56702)
* Returns zone ID for existing zone or `null` * route53_zone: add module unit tests * route53_zone: add compatibility with Python 2.6 to the unit tests * route53_zone: address pycodestyle warning (add blank line)
This commit is contained in:
parent
6ebfe413b0
commit
d88d71e4b1
2 changed files with 611 additions and 1 deletions
|
@ -172,6 +172,7 @@ def create(module, client, matching_zones):
|
|||
'comment': comment,
|
||||
'name': zone_in,
|
||||
'delegation_set_id': delegation_set_id,
|
||||
'zone_id': None,
|
||||
}
|
||||
|
||||
if private_zone:
|
||||
|
@ -287,7 +288,10 @@ def create_or_update_public(module, client, matching_zones, record):
|
|||
module.fail_json_aws(e, msg="Could not create hosted zone")
|
||||
changed = True
|
||||
|
||||
if not module.check_mode:
|
||||
if module.check_mode:
|
||||
if zone_details:
|
||||
record['zone_id'] = zone_details['Id'].replace('/hostedzone/', '')
|
||||
else:
|
||||
record['zone_id'] = zone_details['Id'].replace('/hostedzone/', '')
|
||||
record['name'] = zone_details['Name']
|
||||
record['delegation_set_id'] = zone_delegation_set_details.get('Id', '').replace('/delegationset/', '')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue