-
Notifications
You must be signed in to change notification settings - Fork 403
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ec2_placement_group: Add partition strategy and partition count (#872) (
#928) [PR #872/716ae77f backport][stable-3] ec2_placement_group: Add partition strategy and partition count This is a backport of PR #872 as merged into main (716ae77). SUMMARY Add partition as a strategy and an option, partition_count to choose the actual number of partitions for the community.aws.ec2_placement_group module. Fixes #808 ISSUE TYPE Feature Pull Request COMPONENT NAME ec2_placement_group ADDITIONAL INFO Tested locally with - name: Create a partition placement group with partition count 4. ec2_placement_group: name: my-cluster state: present strategy: partition partition_count: 4
- Loading branch information
1 parent
30ce931
commit d42b7e0
Showing
9 changed files
with
604 additions
and
4 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
changelogs/fragments/872-ec2_placement_group_partition_strategy.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,2 @@ | ||
minor_changes: | ||
- ec2_placement_group - add support for partition strategy and partition count (https://github.com/ansible-collections/community.aws/pull/872). |
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
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,3 @@ | ||
cloud/aws | ||
|
||
ec2_placement_group_info |
1 change: 1 addition & 0 deletions
1
tests/integration/targets/ec2_placement_group/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 @@ | ||
--- |
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 @@ | ||
--- |
94 changes: 94 additions & 0 deletions
94
tests/integration/targets/ec2_placement_group/tasks/env_cleanup.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,94 @@ | ||
- name: remove any instances in the test VPC | ||
ec2_instance: | ||
filters: | ||
vpc_id: "{{ testing_vpc.vpc.id }}" | ||
state: absent | ||
register: removed | ||
until: removed is not failed | ||
ignore_errors: yes | ||
retries: 10 | ||
|
||
- name: Get ENIs | ||
ec2_eni_info: | ||
filters: | ||
vpc-id: "{{ testing_vpc.vpc.id }}" | ||
register: enis | ||
|
||
- name: delete all ENIs | ||
ec2_eni: | ||
eni_id: "{{ item.id }}" | ||
state: absent | ||
until: removed is not failed | ||
with_items: "{{ enis.network_interfaces }}" | ||
ignore_errors: yes | ||
retries: 10 | ||
|
||
- name: remove the security group | ||
ec2_group: | ||
name: "{{ resource_prefix }}-sg" | ||
description: a security group for ansible tests | ||
vpc_id: "{{ testing_vpc.vpc.id }}" | ||
state: absent | ||
register: removed | ||
until: removed is not failed | ||
ignore_errors: yes | ||
retries: 10 | ||
|
||
- name: remove routing rules | ||
ec2_vpc_route_table: | ||
state: absent | ||
vpc_id: "{{ testing_vpc.vpc.id }}" | ||
tags: | ||
created: "{{ resource_prefix }}-route" | ||
routes: | ||
- dest: 0.0.0.0/0 | ||
gateway_id: "{{ igw.gateway_id }}" | ||
subnets: | ||
- "{{ testing_subnet_a.subnet.id }}" | ||
- "{{ testing_subnet_b.subnet.id }}" | ||
register: removed | ||
until: removed is not failed | ||
ignore_errors: yes | ||
retries: 10 | ||
|
||
- name: remove internet gateway | ||
ec2_vpc_igw: | ||
vpc_id: "{{ testing_vpc.vpc.id }}" | ||
state: absent | ||
register: removed | ||
until: removed is not failed | ||
ignore_errors: yes | ||
retries: 10 | ||
|
||
- name: remove subnet A | ||
ec2_vpc_subnet: | ||
state: absent | ||
vpc_id: "{{ testing_vpc.vpc.id }}" | ||
cidr: 10.22.32.0/24 | ||
register: removed | ||
until: removed is not failed | ||
ignore_errors: yes | ||
retries: 10 | ||
|
||
- name: remove subnet B | ||
ec2_vpc_subnet: | ||
state: absent | ||
vpc_id: "{{ testing_vpc.vpc.id }}" | ||
cidr: 10.22.33.0/24 | ||
register: removed | ||
until: removed is not failed | ||
ignore_errors: yes | ||
retries: 10 | ||
|
||
- name: remove the VPC | ||
ec2_vpc_net: | ||
name: "{{ resource_prefix }}-vpc" | ||
cidr_block: 10.22.32.0/23 | ||
state: absent | ||
tags: | ||
Name: Ansible Testing VPC | ||
tenancy: default | ||
register: removed | ||
until: removed is not failed | ||
ignore_errors: yes | ||
retries: 10 |
64 changes: 64 additions & 0 deletions
64
tests/integration/targets/ec2_placement_group/tasks/env_setup.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,64 @@ | ||
- name: Create VPC for use in testing | ||
ec2_vpc_net: | ||
name: "{{ resource_prefix }}-vpc" | ||
cidr_block: 10.22.32.0/23 | ||
tags: | ||
Name: Ansible ec2_lc Testing VPC | ||
tenancy: default | ||
register: testing_vpc | ||
|
||
- name: Create internet gateway for use in testing | ||
ec2_vpc_igw: | ||
vpc_id: "{{ testing_vpc.vpc.id }}" | ||
state: present | ||
tags: | ||
Name: Ansible ec2_lc Testing gateway | ||
register: igw | ||
|
||
- name: Create default subnet in zone A | ||
ec2_vpc_subnet: | ||
state: present | ||
vpc_id: "{{ testing_vpc.vpc.id }}" | ||
cidr: 10.22.32.0/24 | ||
az: "{{ aws_region }}a" | ||
resource_tags: | ||
Name: "{{ resource_prefix }}-subnet-a" | ||
register: testing_subnet_a | ||
|
||
- name: Create secondary subnet in zone B | ||
ec2_vpc_subnet: | ||
state: present | ||
vpc_id: "{{ testing_vpc.vpc.id }}" | ||
cidr: 10.22.33.0/24 | ||
az: "{{ aws_region }}b" | ||
resource_tags: | ||
Name: "{{ resource_prefix }}-subnet-b" | ||
register: testing_subnet_b | ||
|
||
- name: create routing rules | ||
ec2_vpc_route_table: | ||
vpc_id: "{{ testing_vpc.vpc.id }}" | ||
tags: | ||
created: "{{ resource_prefix }}-route" | ||
routes: | ||
- dest: 0.0.0.0/0 | ||
gateway_id: "{{ igw.gateway_id }}" | ||
subnets: | ||
- "{{ testing_subnet_a.subnet.id }}" | ||
- "{{ testing_subnet_b.subnet.id }}" | ||
|
||
- name: create a security group with the vpc | ||
ec2_group: | ||
name: "{{ resource_prefix }}-sg" | ||
description: a security group for ansible tests | ||
vpc_id: "{{ testing_vpc.vpc.id }}" | ||
rules: | ||
- proto: tcp | ||
from_port: 22 | ||
to_port: 22 | ||
cidr_ip: 0.0.0.0/0 | ||
- proto: tcp | ||
from_port: 80 | ||
to_port: 80 | ||
cidr_ip: 0.0.0.0/0 | ||
register: sg |
Oops, something went wrong.