2018-11-09 13:11:51 +01:00
|
|
|
- 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
|
2019-05-10 20:43:15 +02:00
|
|
|
wait: false
|
2018-11-09 13:11:51 +01:00
|
|
|
<<: *aws_connection_info
|
|
|
|
register: ebs_opt_in_vpc
|
|
|
|
|
2019-05-10 20:43:15 +02:00
|
|
|
- name: Get ec2 instance info
|
2019-06-10 19:33:38 +02:00
|
|
|
ec2_instance_info:
|
2018-11-09 13:11:51 +01:00
|
|
|
filters:
|
|
|
|
"tag:Name": "{{ resource_prefix }}-test-ebs-optimized-instance-in-vpc"
|
|
|
|
<<: *aws_connection_info
|
2019-05-10 20:43:15 +02:00
|
|
|
register: ebs_opt_instance_info
|
2018-11-09 13:11:51 +01:00
|
|
|
|
|
|
|
- name: Assert instance is ebs_optimized
|
|
|
|
assert:
|
|
|
|
that:
|
2019-05-10 20:43:15 +02:00
|
|
|
- "{{ ebs_opt_instance_info.instances.0.ebs_optimized }}"
|