From 3bd89f8298c10b2c76fb44dbcbc64596921c38ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toma=C5=BE=20=C5=A0ifrer?= Date: Thu, 7 Sep 2017 13:23:17 +0100 Subject: [PATCH] Fix: modifying existing application lb using certificates now properly sets certificates (#28217) --- lib/ansible/modules/cloud/amazon/elb_application_lb.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/ansible/modules/cloud/amazon/elb_application_lb.py b/lib/ansible/modules/cloud/amazon/elb_application_lb.py index e426dde7ba8..de9dc79c3cb 100644 --- a/lib/ansible/modules/cloud/amazon/elb_application_lb.py +++ b/lib/ansible/modules/cloud/amazon/elb_application_lb.py @@ -538,9 +538,13 @@ def compare_listener(current_listener, new_listener): if current_listener['SslPolicy'] != new_listener['SslPolicy']: modified_listener['SslPolicy'] = new_listener['SslPolicy'] if current_listener['Certificates'][0]['CertificateArn'] != new_listener['Certificates'][0]['CertificateArn']: + modified_listener['Certificates'] = [] + modified_listener['Certificates'].append({}) modified_listener['Certificates'][0]['CertificateArn'] = new_listener['Certificates'][0]['CertificateArn'] elif current_listener['Protocol'] != 'HTTPS' and new_listener['Protocol'] == 'HTTPS': modified_listener['SslPolicy'] = new_listener['SslPolicy'] + modified_listener['Certificates'] = [] + modified_listener['Certificates'].append({}) modified_listener['Certificates'][0]['CertificateArn'] = new_listener['Certificates'][0]['CertificateArn'] # Default action