From d16ec175fcc17f29e081f4fab4d8b9fc5842ebae Mon Sep 17 00:00:00 2001 From: s-hertel Date: Tue, 19 Feb 2019 09:41:09 -0600 Subject: [PATCH] If the private_ip has been provided for the new network interface it shouldn't also be added to top level parameters for run_instances changelog --- .../fragments/ec2_fix_assigning_private_without_public_ip.yml | 3 +++ lib/ansible/modules/cloud/amazon/ec2.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/ec2_fix_assigning_private_without_public_ip.yml diff --git a/changelogs/fragments/ec2_fix_assigning_private_without_public_ip.yml b/changelogs/fragments/ec2_fix_assigning_private_without_public_ip.yml new file mode 100644 index 00000000000..0ee7fb9cd22 --- /dev/null +++ b/changelogs/fragments/ec2_fix_assigning_private_without_public_ip.yml @@ -0,0 +1,3 @@ +bugfixes: + - ec2 - if the private_ip has been provided for the new network interface it shouldn't also be added to top level + parameters for run_instances() diff --git a/lib/ansible/modules/cloud/amazon/ec2.py b/lib/ansible/modules/cloud/amazon/ec2.py index f7130b723c7..bda2cba2f2b 100644 --- a/lib/ansible/modules/cloud/amazon/ec2.py +++ b/lib/ansible/modules/cloud/amazon/ec2.py @@ -1112,7 +1112,7 @@ def create_instances(module, ec2, vpc, override_count=None): # check to see if we're using spot pricing first before starting instances if not spot_price: - if assign_public_ip and private_ip: + if assign_public_ip is not None and private_ip: params.update( dict( min_count=count_remaining,