mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 22:33:25 +00:00
New module: ec2_instance (#35749)
New module: ec2_instance Integration tests for ec2_instance
This commit is contained in:
committed by
Sloane Hertel
parent
663c410da4
commit
e71c6d8e17
@@ -0,0 +1,31 @@
|
||||
- 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: New instance with an extra block device
|
||||
ec2_instance:
|
||||
name: "{{ resource_prefix }}-test-ebs-vols"
|
||||
image_id: "{{ ec2_ami_image[aws_region] }}"
|
||||
vpc_subnet_id: "{{ testing_subnet_b.subnet.id }}"
|
||||
volumes:
|
||||
- device_name: /dev/sdb
|
||||
ebs:
|
||||
volume_size: 20
|
||||
delete_on_termination: true
|
||||
volume_type: standard
|
||||
tags:
|
||||
TestId: "{{ resource_prefix }}"
|
||||
instance_type: t2.micro
|
||||
<<: *aws_connection_info
|
||||
register: in_test_vpc
|
||||
- assert:
|
||||
that:
|
||||
- in_test_vpc is not failed
|
||||
- in_test_vpc is changed
|
||||
- in_test_vpc.instances[0].block_device_mappings[0]
|
||||
- in_test_vpc.instances[0].block_device_mappings[1]
|
||||
- in_test_vpc.instances[0].block_device_mappings[1].device_name == '/dev/sdb'
|
||||
Reference in New Issue
Block a user