mirror of https://github.com/ansible/ansible.git
(Backport) ec2_instance, ebs_optimized not sub-option of network (#48467)
* ec2_instance: ebs_optimized is not sub-option of 'network' (#48341)
* ebs_optimized is not suboption of 'network'
* Add Shaps as ec2_instance maintainer
* Added workaround-backward compatible check for ebs_optimized
* Added ebs_optimized test
* CI fixes, dynamic select of ENA-enabled AMI
(cherry picked from commit b7d9feb7dc)
* Added changlog fragment for PR #48341
* fixed yaml errors in changelog
pull/48588/head
parent
483226cdce
commit
50e6361c3f
@ -0,0 +1,2 @@
|
||||
bugfixes:
|
||||
- "ec2_instance: - Fixed issue where ebs_optimized was considered sub-option of the network parameter. (https://github.com/ansible/ansible/issues/48159)"
|
||||
@ -0,0 +1,34 @@
|
||||
- name: set connection information for all tasks
|
||||
set_fact:
|
||||
aws_connection_info: &aws_connection_info
|
||||
aws_access_key: "{{ aws_access_key }}"
|
||||
aws_secret_key: "{{ aws_secret_key }}"
|
||||
security_token: "{{ security_token }}"
|
||||
region: "{{ aws_region }}"
|
||||
no_log: true
|
||||
|
||||
- name: Make EBS optimized instance in the testing subnet of the test VPC
|
||||
ec2_instance:
|
||||
name: "{{ resource_prefix }}-test-ebs-optimized-instance-in-vpc"
|
||||
image_id: "{{ ec2_ebs_optimized_ami_image[aws_region] }}"
|
||||
tags:
|
||||
TestId: "{{ resource_prefix }}"
|
||||
security_groups: "{{ sg.group_id }}"
|
||||
vpc_subnet_id: "{{ testing_subnet_b.subnet.id }}"
|
||||
ebs_optimized: true
|
||||
instance_type: t3.nano
|
||||
<<: *aws_connection_info
|
||||
register: ebs_opt_in_vpc
|
||||
|
||||
- name: Get ec2 instance facts
|
||||
ec2_instance_facts:
|
||||
filters:
|
||||
"tag:Name": "{{ resource_prefix }}-test-ebs-optimized-instance-in-vpc"
|
||||
"instance-state-name": "running"
|
||||
<<: *aws_connection_info
|
||||
register: ebs_opt_instance_fact
|
||||
|
||||
- name: Assert instance is ebs_optimized
|
||||
assert:
|
||||
that:
|
||||
- "{{ ebs_opt_instance_fact.instances.0.ebs_optimized }}"
|
||||
Loading…
Reference in New Issue