-
Notifications
You must be signed in to change notification settings - Fork 336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ec2_instance: fix to handle create instance in specified AZ #1150
Merged
softwarefactory-project-zuul
merged 3 commits into
ansible-collections:main
from
mandar242:ec2_instance_subnet_fix
Oct 11, 2022
Merged
ec2_instance: fix to handle create instance in specified AZ #1150
softwarefactory-project-zuul
merged 3 commits into
ansible-collections:main
from
mandar242:ec2_instance_subnet_fix
Oct 11, 2022
Conversation
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
ansibullbot
added
bug
This issue/PR relates to a bug
community_review
module
module
needs_triage
plugins
plugin (any type)
small_patch
Hopefully easy to review
labels
Oct 10, 2022
This comment was marked as outdated.
This comment was marked as outdated.
ansibullbot
added
integration
tests/integration
tests
tests
and removed
small_patch
Hopefully easy to review
labels
Oct 10, 2022
gravesm
approved these changes
Oct 11, 2022
1 task
goneri
approved these changes
Oct 11, 2022
Backport to stable-5: 💚 backport PR created✅ Backport PR branch: Backported as #1184 🤖 @patchback |
patchback bot
pushed a commit
that referenced
this pull request
Oct 19, 2022
ec2_instance: fix to handle create instance in specified AZ SUMMARY This PR adds a fix to allow launching an instance in specified AZ when vpc_subnet_id is not specified. The current code does not consider the AZ and launches the instance in default subnet of default vpc for the specified region. https://github.com/ansible-collections/amazon.aws/blob/main/plugins/modules/ec2_instance.py#L1584-L1593 Fixes #1120 ISSUE TYPE Bugfix Pull Request COMPONENT NAME ec2_instance ADDITIONAL INFORMATION Without the fix, the below playbook will launch instance in default subnet ignoring specified AZ. Example Playbook to launch instance in us-west-2b AZ. --- - name: Spin up ec2 instance hosts: localhost gather_facts: false tasks: - name: Launch regular ec2 instances in us-west-1b amazon.aws.ec2_instance: name: "test-instance-us-west-1b" instance_type: t2.micro image_id: ami-xxxxx state: present availability_zone: us-west-1b region: us-west-1 tags: terminate-this: yes network: assign_public_ip: yes register: create_result - ec2_instance_info: instance_ids: - "{{ create_result.instance_ids[0] }}" region: us-west-1 register: info_result - assert: that: info_result.instances[0].placement.availability_zone == 'us-west-1b' Reviewed-by: Mike Graves <[email protected]> Reviewed-by: Gonéri Le Bouder <[email protected]> (cherry picked from commit 395d4fd)
softwarefactory-project-zuul bot
pushed a commit
that referenced
this pull request
Oct 19, 2022
…1184) [PR #1150/395d4fda backport][stable-5] ec2_instance: fix to handle create instance in specified AZ This is a backport of PR #1150 as merged into main (395d4fd). SUMMARY This PR adds a fix to allow launching an instance in specified AZ when vpc_subnet_id is not specified. The current code does not consider the AZ and launches the instance in default subnet of default vpc for the specified region. https://github.com/ansible-collections/amazon.aws/blob/main/plugins/modules/ec2_instance.py#L1584-L1593 Fixes #1120 ISSUE TYPE Bugfix Pull Request COMPONENT NAME ec2_instance ADDITIONAL INFORMATION Without the fix, the below playbook will launch instance in default subnet ignoring specified AZ. Example Playbook to launch instance in us-west-2b AZ. --- - name: Spin up ec2 instance hosts: localhost gather_facts: false tasks: - name: Launch regular ec2 instances in us-west-1b amazon.aws.ec2_instance: name: "test-instance-us-west-1b" instance_type: t2.micro image_id: ami-xxxxx state: present availability_zone: us-west-1b region: us-west-1 tags: terminate-this: yes network: assign_public_ip: yes register: create_result - ec2_instance_info: instance_ids: - "{{ create_result.instance_ids[0] }}" region: us-west-1 register: info_result - assert: that: info_result.instances[0].placement.availability_zone == 'us-west-1b' Reviewed-by: Mark Chappell <None>
1 task
abikouo
pushed a commit
to abikouo/amazon.aws
that referenced
this pull request
Sep 18, 2023
aws_secret - Support purge_tags SUMMARY aws_secret currently defaults to purging all tags (even if tags isn't specified), this is a little aggressive. Add purge_tags parameter Only purge tags if tags: {} is set (rather than when tags is None ISSUE TYPE Feature Pull Request COMPONENT NAME aws_secret ADDITIONAL INFORMATION Related to ansible-collections#1146 Reviewed-by: Markus Bergholz <[email protected]> Reviewed-by: Mark Chappell <None> Reviewed-by: Alina Buzachis <None>
abikouo
pushed a commit
to abikouo/amazon.aws
that referenced
this pull request
Sep 18, 2023
aws_secret - Support purge_tags SUMMARY aws_secret currently defaults to purging all tags (even if tags isn't specified), this is a little aggressive. Add purge_tags parameter Only purge tags if tags: {} is set (rather than when tags is None ISSUE TYPE Feature Pull Request COMPONENT NAME aws_secret ADDITIONAL INFORMATION Related to ansible-collections#1146 Reviewed-by: Markus Bergholz <[email protected]> Reviewed-by: Mark Chappell <None> Reviewed-by: Alina Buzachis <None>
abikouo
pushed a commit
to abikouo/amazon.aws
that referenced
this pull request
Oct 24, 2023
aws_secret - Support purge_tags SUMMARY aws_secret currently defaults to purging all tags (even if tags isn't specified), this is a little aggressive. Add purge_tags parameter Only purge tags if tags: {} is set (rather than when tags is None ISSUE TYPE Feature Pull Request COMPONENT NAME aws_secret ADDITIONAL INFORMATION Related to ansible-collections#1146 Reviewed-by: Markus Bergholz <[email protected]> Reviewed-by: Mark Chappell <None> Reviewed-by: Alina Buzachis <None>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
backport-5
PR should be backported to the stable-5 branch
bug
This issue/PR relates to a bug
community_review
has_issue
integration
tests/integration
mergeit
Merge the PR (SoftwareFactory)
module
module
plugins
plugin (any type)
tests
tests
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SUMMARY
This PR adds a fix to allow launching an instance in specified AZ when
vpc_subnet_id
is not specified.The current code does not consider the AZ and launches the instance in
default subnet
ofdefault vpc
for the specified region.https://github.com/ansible-collections/amazon.aws/blob/main/plugins/modules/ec2_instance.py#L1584-L1593
Fixes #1120
ISSUE TYPE
COMPONENT NAME
ec2_instance
ADDITIONAL INFORMATION
Without the fix, the below playbook will launch instance in
default subnet
ignoring specifiedAZ
.Example Playbook to launch instance in
us-west-2b
AZ.