2019-07-04 21:25:19 +02:00
|
|
|
- block:
|
|
|
|
- name: create t3.nano with cpu options (fails gracefully)
|
|
|
|
ec2_instance:
|
|
|
|
state: present
|
|
|
|
name: "ansible-test-{{ resource_prefix | regex_search('([0-9]+)$') }}-ec2"
|
2019-10-21 14:55:44 +02:00
|
|
|
image_id: "{{ ec2_ami_image }}"
|
|
|
|
instance_type: "t3.nano"
|
2019-07-04 21:25:19 +02:00
|
|
|
cpu_options:
|
|
|
|
core_count: 1
|
|
|
|
threads_per_core: 1
|
|
|
|
register: ec2_instance_cpu_options_creation
|
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
- name: check that graceful error message is returned when creation with cpu_options and old botocore
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- ec2_instance_cpu_options_creation.failed
|
|
|
|
- 'ec2_instance_cpu_options_creation.msg == "cpu_options is only supported with botocore >= 1.10.16"'
|
|
|
|
|
|
|
|
always:
|
|
|
|
- name: cleanup t3.nano in case graceful failure was in fact a graceful success
|
|
|
|
ec2_instance:
|
|
|
|
state: absent
|
|
|
|
name: "ansible-test-{{ resource_prefix | regex_search('([0-9]+)$') }}-ec2"
|
2019-10-21 14:55:44 +02:00
|
|
|
wait: no
|
2019-07-04 21:25:19 +02:00
|
|
|
ignore_errors: yes
|