From f58bd4f392f4a67fa985a45a5256592cd859db2c Mon Sep 17 00:00:00 2001 From: Willem van Ketwich Date: Sat, 9 Sep 2017 02:30:35 +1000 Subject: [PATCH] [cloud] EC2 AutoScaling fix for respecting zero as the desired, min&max size values (#27870) --- lib/ansible/modules/cloud/amazon/ec2_asg.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ansible/modules/cloud/amazon/ec2_asg.py b/lib/ansible/modules/cloud/amazon/ec2_asg.py index 2edd74369fd..9c870f70e2b 100644 --- a/lib/ansible/modules/cloud/amazon/ec2_asg.py +++ b/lib/ansible/modules/cloud/amazon/ec2_asg.py @@ -942,9 +942,9 @@ def create_autoscaling_group(connection, module): attach_lb_target_groups(connection, group_name, tgs_to_attach) # check for attributes that aren't required for updating an existing ASG - desired_capacity = desired_capacity or as_group['DesiredCapacity'] - min_size = min_size or as_group['MinSize'] - max_size = max_size or as_group['MaxSize'] + desired_capacity = desired_capacity if desired_capacity is not None else as_group['DesiredCapacity'] + min_size = min_size if min_size is not None else as_group['MinSize'] + max_size = max_size if max_size is not None else as_group['MaxSize'] launch_config_name = launch_config_name or as_group['LaunchConfigurationName'] launch_configs = describe_launch_configurations(connection, launch_config_name)