route53_info max_items and next_marker should be a str (#64617)

* route53_info  max_items and next_marker should be a str

Type was changed in #64358, however boto3 takes a str for this option
Add some basic tests for route53_info.
Fixes: #64534
pull/70739/head
Jill R 6 years ago committed by GitHub
parent 84bffff96a
commit 4e7779030d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -52,7 +52,7 @@ options:
description: description:
- Maximum number of items to return for various get/list requests. - Maximum number of items to return for various get/list requests.
required: false required: false
type: int type: str
next_marker: next_marker:
description: description:
- "Some requests such as list_command: hosted_zones will return a maximum - "Some requests such as list_command: hosted_zones will return a maximum
@ -61,7 +61,7 @@ options:
using the NextMarker entry from the first response to get the next page using the NextMarker entry from the first response to get the next page
of results." of results."
required: false required: false
type: int type: str
delegation_set_id: delegation_set_id:
description: description:
- The DNS Zone delegation set ID. - The DNS Zone delegation set ID.
@ -417,8 +417,8 @@ def main():
], required=True), ], required=True),
change_id=dict(), change_id=dict(),
hosted_zone_id=dict(), hosted_zone_id=dict(),
max_items=dict(type='int'), max_items=dict(),
next_marker=dict(type='int'), next_marker=dict(),
delegation_set_id=dict(), delegation_set_id=dict(),
start_record_name=dict(), start_record_name=dict(),
type=dict(choices=[ type=dict(choices=[

@ -1,2 +1,3 @@
route53_info
cloud/aws cloud/aws
shippable/aws/group2 shippable/aws/group2

@ -21,8 +21,23 @@
comment: Created in Ansible test {{ resource_prefix }} comment: Created in Ansible test {{ resource_prefix }}
register: z1 register: z1
- debug: msg='TODO write tests' - assert:
- debug: var=z1 that:
- z1 is success
- z1 is changed
- "z1.comment == 'Created in Ansible test {{ resource_prefix }}'"
- name: Get zone details
route53_info:
query: hosted_zone
hosted_zone_id: '{{ z1.zone_id }}'
hosted_zone_method: details
register: hosted_zones
- name: Assert newly created hosted zone only has NS and SOA records
assert:
that:
- hosted_zones.HostedZone.ResourceRecordSetCount == 2
- name: Create A record using zone fqdn - name: Create A record using zone fqdn
route53: route53:
@ -93,6 +108,21 @@
- mv_a_record is not failed - mv_a_record is not failed
- mv_a_record is not changed - mv_a_record is not changed
- name: get Route53 A record information
route53_info:
type: A
query: record_sets
hosted_zone_id: '{{ z1.zone_id }}'
start_record_name: 'order_test.{{ zone_one }}'
max_items: 50
register: records
- assert:
that:
- records.ResourceRecordSets|length == 3
- records.ResourceRecordSets[0].ResourceRecords|length == 2
- records.ResourceRecordSets[0].ResourceRecords[0].Value == "4.5.6.7"
- records.ResourceRecordSets[0].ResourceRecords[1].Value == "1.2.3.4"
- name: Remove a member from multi-value A record with values in different order - name: Remove a member from multi-value A record with values in different order
route53: route53:
state: present state: present
@ -119,12 +149,26 @@
- 4.5.6.7 - 4.5.6.7
register: del_a_record register: del_a_record
ignore_errors: true ignore_errors: true
- name: This should fail, because `overwrite` is false - name: This should not fail, because `overwrite` is true
assert: assert:
that: that:
- del_a_record is not failed - del_a_record is not failed
- del_a_record is changed - del_a_record is changed
- name: get Route53 zone A record information
route53_info:
type: A
query: record_sets
hosted_zone_id: '{{ z1.zone_id }}'
start_record_name: 'order_test.{{ zone_one }}'
max_items: 50
register: records
- assert:
that:
- records.ResourceRecordSets|length == 3
- records.ResourceRecordSets[0].ResourceRecords|length == 1
- records.ResourceRecordSets[0].ResourceRecords[0].Value == "4.5.6.7"
- name: Create a LetsEncrypt CAA record - name: Create a LetsEncrypt CAA record
route53: route53:
state: present state: present
@ -173,6 +217,8 @@
that: that:
- caa is not failed - caa is not failed
- caa is not changed - caa is not changed
always: always:
- route53_info: - route53_info:
query: record_sets query: record_sets

Loading…
Cancel
Save