-
Notifications
You must be signed in to change notification settings - Fork 343
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ec2_instance - add support for
placement
and `license_specification…
…s` (#1825) ec2_instance - add support for `placement` and `license_specifications` SUMMARY Adding placement options and license specifications support Fixes #1824 ISSUE TYPE Feature Pull Request COMPONENT NAME ec2_instance ADDITIONAL INFORMATION Reviewed-by: Mark Chappell Reviewed-by: Math Fortin Reviewed-by: Helen Bailey <hebailey@redhat.com> Reviewed-by: Alina Buzachis
- Loading branch information
Showing
10 changed files
with
305 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
minor_changes: | ||
- ec2_instance - add support for additional ``placement`` options and ``license_specifications`` in run instance spec (https://github.com/ansible-collections/amazon.aws/issues/1824). | ||
deprecated_features: | ||
- ec2_instance - deprecation of ``tenancy`` and ``placement_group`` in favor of ``placement`` attribute (https://github.com/ansible-collections/amazon.aws/pull/1825). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
tests/integration/targets/ec2_instance_license_specifications/aliases
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
time=10m | ||
|
||
cloud/aws | ||
|
||
ec2_instance_info | ||
ec2_instance |
6 changes: 6 additions & 0 deletions
6
tests/integration/targets/ec2_instance_license_specifications/defaults/main.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
# defaults file for ec2_instance_block_devices | ||
ec2_instance_type: 't3.micro' | ||
ec2_instance_tag_TestId: '{{ resource_prefix }}-license-specifications' | ||
ec2_host_resource_group_arn: 'arn:aws:resource-groups:{{ aws_region }}:123456789012:group/{{ resource_prefix }}-resource-group' | ||
ec2_license_configuration_arn: 'arn:aws:license-manager:{{ aws_region }}:123456789012:license-configuration:lic-0123456789' |
6 changes: 6 additions & 0 deletions
6
tests/integration/targets/ec2_instance_license_specifications/meta/main.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# this just makes sure they're in the right place | ||
dependencies: | ||
- role: setup_ec2_facts | ||
- role: setup_ec2_instance_env | ||
vars: | ||
ec2_instance_test_name: license_specifications |
29 changes: 29 additions & 0 deletions
29
tests/integration/targets/ec2_instance_license_specifications/tasks/main.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
- module_defaults: | ||
group/aws: | ||
access_key: "{{ aws_access_key }}" | ||
secret_key: "{{ aws_secret_key }}" | ||
session_token: "{{ security_token | default(omit) }}" | ||
region: "{{ aws_region }}" | ||
block: | ||
- name: "New instance with license specifications" | ||
ec2_instance: | ||
state: running | ||
name: "{{ resource_prefix }}-test-ebs-vols" | ||
image_id: "{{ ec2_ami_id }}" | ||
vpc_subnet_id: "{{ testing_subnet_b.subnet.id }}" | ||
placement: | ||
host_resource_group_arn: "{{ ec2_host_resource_group_arn }}" | ||
license_specifications: | ||
- license_configuration_arn: "{{ ec2_license_configuration_arn }}" | ||
tags: | ||
TestId: "{{ ec2_instance_tag_TestId }}" | ||
instance_type: "{{ ec2_instance_type }}" | ||
wait: true | ||
ignore_errors: true | ||
register: instance_creation | ||
|
||
- name: "Validate instance with license specifications" | ||
assert: | ||
that: | ||
- instance_creation is failed | ||
- '"An instance is associated with one or more unshared license configurations." in instance_creation.msg' |
6 changes: 6 additions & 0 deletions
6
tests/integration/targets/ec2_instance_placement_options/aliases
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
time=10m | ||
|
||
cloud/aws | ||
|
||
ec2_instance_info | ||
ec2_instance |
6 changes: 6 additions & 0 deletions
6
tests/integration/targets/ec2_instance_placement_options/defaults/main.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
# defaults file for ec2_instance_block_devices | ||
ec2_instance_type: 't3.micro' | ||
ec2_instance_tag_TestId: '{{ resource_prefix }}-placement-group' | ||
ec2_tenancy: 'dedicated' | ||
ec2_placement_group_name: '{{ resource_prefix}}-placement-group' |
6 changes: 6 additions & 0 deletions
6
tests/integration/targets/ec2_instance_placement_options/meta/main.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# this just makes sure they're in the right place | ||
dependencies: | ||
- role: setup_ec2_facts | ||
- role: setup_ec2_instance_env | ||
vars: | ||
ec2_instance_test_name: placement_options |
Oops, something went wrong.