From bc9074404edb043b98576f34a719b34dcdf311f7 Mon Sep 17 00:00:00 2001 From: Martin Krizek Date: Wed, 24 Apr 2019 13:40:48 +0200 Subject: [PATCH] ec2_instance: remove network.ebs_optimized option (#55694) Fixes #55307 --- changelogs/fragments/55307-ec2_instance-deprecations.yaml | 2 ++ lib/ansible/modules/cloud/amazon/ec2_instance.py | 6 ------ 2 files changed, 2 insertions(+), 6 deletions(-) create mode 100644 changelogs/fragments/55307-ec2_instance-deprecations.yaml diff --git a/changelogs/fragments/55307-ec2_instance-deprecations.yaml b/changelogs/fragments/55307-ec2_instance-deprecations.yaml new file mode 100644 index 00000000000..d780f648eba --- /dev/null +++ b/changelogs/fragments/55307-ec2_instance-deprecations.yaml @@ -0,0 +1,2 @@ +minor_changes: + - ec2_instance - Remove deprecated ``network.ebs_optimized`` option (https://github.com/ansible/ansible/issues/55307) diff --git a/lib/ansible/modules/cloud/amazon/ec2_instance.py b/lib/ansible/modules/cloud/amazon/ec2_instance.py index 83ba89e1c29..011d1cce18e 100644 --- a/lib/ansible/modules/cloud/amazon/ec2_instance.py +++ b/lib/ansible/modules/cloud/amazon/ec2_instance.py @@ -1126,9 +1126,6 @@ def build_top_level_options(params): spec.setdefault('Placement', {'GroupName': str(params.get('placement_group'))}) if params.get('ebs_optimized') is not None: spec['EbsOptimized'] = params.get('ebs_optimized') - elif (params.get('network') or {}).get('ebs_optimized') is not None: - # Backward compatibility for workaround described in https://github.com/ansible/ansible/issues/48159 - spec['EbsOptimized'] = params['network'].get('ebs_optimized') if params.get('instance_initiated_shutdown_behavior'): spec['InstanceInitiatedShutdownBehavior'] = params.get('instance_initiated_shutdown_behavior') if params.get('termination_protection') is not None: @@ -1625,9 +1622,6 @@ def main(): ) if module.params.get('network'): - if 'ebs_optimized' in module.params['network']: - module.deprecate("network.ebs_optimized is deprecated." - "Use the top level ebs_optimized parameter instead", 2.9) if module.params.get('network').get('interfaces'): if module.params.get('security_group'): module.fail_json(msg="Parameter network.interfaces can't be used with security_group")