Skip to content
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

Bug Fix: Route 53 Health Check behaves incorrectly with > 100 health checks #58539

Merged
merged 1 commit into from
Jul 11, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
30 changes: 19 additions & 11 deletions lib/ansible/modules/cloud/amazon/route53_health_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,17 +145,25 @@
# string_match if not previously enabled
def find_health_check(conn, wanted):
"""Searches for health checks that have the exact same set of immutable values"""
for check in conn.get_list_health_checks().HealthChecks:
config = check.HealthCheckConfig
if (
config.get('IPAddress') == wanted.ip_addr and
config.get('FullyQualifiedDomainName') == wanted.fqdn and
config.get('Type') == wanted.hc_type and
config.get('RequestInterval') == str(wanted.request_interval) and
config.get('Port') == str(wanted.port)
):
return check
return None

results = conn.get_list_health_checks()

while True:
for check in results.HealthChecks:
config = check.HealthCheckConfig
if (
config.get('IPAddress') == wanted.ip_addr and
config.get('FullyQualifiedDomainName') == wanted.fqdn and
config.get('Type') == wanted.hc_type and
config.get('RequestInterval') == str(wanted.request_interval) and
config.get('Port') == str(wanted.port)
):
return check

if (results.IsTruncated == 'true'):
results = conn.get_list_health_checks(marker=results.NextMarker)
else:
return None


def to_health_check(config):
Expand Down