-
Notifications
You must be signed in to change notification settings - Fork 397
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
Add asg refresh and info modules #487
Add asg refresh and info modules #487
Conversation
/rebuild_failed |
Hi @danquixote, Thank you for the PR. I re-assign @tremble to it since he was already reviewing the original PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking the time to submit this PR.
The code itself looks reasonable.
The docs need a little work, I've highlighted an example of each type of issue in the docs, rather than adding a suggestion for each time the same issue occurs.
It should be possible to merge the two test targets. This helps to ensure that changes to one module don't affect the other, and also generally reduces the time taken to run the tests since you don't have all of the setup/tear-down time.
--- | ||
module: ec2_asg_instance_refresh | ||
version_added: 1.0.0 | ||
short_description: Start or cancel an ec2 Auto Scaling Group (ASG) Instance Refresh in AWS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
short_description: Start or cancel an ec2 Auto Scaling Group (ASG) Instance Refresh in AWS | |
short_description: Start or cancel an EC2 Auto Scaling Group (ASG) instance refresh in AWS |
(nit) EC2 is a product name, the capitalization should follow the product owner's capitalization where possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 1cacca4
version_added: 1.0.0 | ||
short_description: Start or cancel an ec2 Auto Scaling Group (ASG) Instance Refresh in AWS | ||
description: | ||
- Start or cancel an ec2 Auto Scaling Group Instance Refresh in AWS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Start or cancel an ec2 Auto Scaling Group Instance Refresh in AWS | |
- Start or cancel an EC2 Auto Scaling Group instance refresh in AWS. |
While short_description
fields shouldn't have a full stop at the end, description
fields should be complete sentences, including a full stop at the end. While there's plenty of bad examples around, we are slowly cleaning them up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in f2ec8ae
preferences: | ||
description: | ||
- Set of preferences associated with the instance refresh request. | ||
- If not provided, the default values are used. For MinHealthyPercentage, the default value is 90. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- If not provided, the default values are used. For MinHealthyPercentage, the default value is 90. | |
- If not provided, the default values are used. | |
- For I(min_healthy_percentage), the default value is C(90). |
When referring to other parameters you can should use I(<param_name>)
, when referring to values use C(<value>)
. This will then result in formatting which makes it a little easier to distinguish.
You can also do When I(my_param=SomeValue)...
where referring to a specific parameter having a specific value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in f2ec8ae
state=dict( | ||
type='str', | ||
required=True, | ||
choices=['started', 'canceled'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The past tense of cancel is cancelled (with two 'l's)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 47e6165
- You can determine the status of a request by looking at the Status parameter. The following are the possible statuses | ||
- Pending -- The request was created, but the operation has not started. | ||
- InProgress -- The operation is in progress. | ||
- Successful -- The operation completed successfully. | ||
- Failed -- The operation failed to complete. You can troubleshoot using the status reason and the scaling activities. | ||
- Cancelling -- | ||
- An ongoing operation is being cancelled. | ||
- Cancellation does not roll back any replacements that have already been completed, | ||
- but it prevents new replacements from being started. | ||
- Cancelled -- The operation is cancelled. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better to move most of this description into the return documentation.
- You can determine the status of a request by looking at the Status parameter. The following are the possible statuses | |
- Pending -- The request was created, but the operation has not started. | |
- InProgress -- The operation is in progress. | |
- Successful -- The operation completed successfully. | |
- Failed -- The operation failed to complete. You can troubleshoot using the status reason and the scaling activities. | |
- Cancelling -- | |
- An ongoing operation is being cancelled. | |
- Cancellation does not roll back any replacements that have already been completed, | |
- but it prevents new replacements from being started. | |
- Cancelled -- The operation is cancelled. | |
- You can determine the status of a request by looking at the I(status) parameter. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in f2ec8ae
--- | ||
# defaults file for ec2_asg | ||
# Amazon Linux 2 AMI 2019.06.12 (HVM), GP2 Volume Type | ||
ec2_ami_name: 'amzn2-ami-hvm-2.0.20190612-x86_64-gp2' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We generally use a wildcard here and then filter it. See for example:
tests/integration/targets/ec2_instance/roles/ec2_instance/tasks/find_ami.yml
This allows for pulling in fixes that might be related to things like hardware support.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I included this by mimicking the ec2_asg module...Fixed in 667e501
- name: Create VPC for use in testing | ||
ec2_vpc_net: | ||
name: "{{ resource_prefix }}-vpc" | ||
cidr_block: 10.55.77.0/24 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer using a random subnet here rather than hard coding values. It reduces the risks of collisions when things are run in parallel.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also an artifact of mimicking ec2_asg...Got a good example from ec2_instance. (Hopefully) fixed in 3392ef7
cloud/aws | ||
ec2_asg_instance_refreshes_info |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to duplicate the tests here. You can merge the ec2_asg_instance_refreshes_info and ec2_asg_instance_refresh targets and add ec2_asg_instance_refreshes_info to the aliases file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I understand what you're saying, and it would of course make sense to combine the two test-"suites" for these related modules into one. However, I'm not 100% sure I did it correctly. Calling each still only runs the tests only for that module. Attempted fix in da9fe1b
aws_access_key: "{{ aws_access_key }}" | ||
aws_secret_key: "{{ aws_secret_key }}" | ||
region: "{{ aws_region }}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't be needed and won't work in CI because we use session tokens.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 958a04a
Hi @tremble. Thank you very much for your code-review. I haven't touched this code in a while, but will go over your comments this week and will hopefully also get my builds to pass. ---Also, it looks like I submitted this PR before the Shippable deprecation on May 3rd. Should I still continue work within this PR, or would it be better to open a 'fresh' one? |
---Also, it looks like I submitted this PR before the Shippable
deprecation on May 3rd. Should I still continue work within this PR, or
would it be better to open a 'fresh' one?
When you push your new commits it'll automatically switch the shippable
tests for the zuul tests we're now using.
Mark
|
47e6165
to
52b5cbc
Compare
812a396
to
c55e32d
Compare
c64eef5
to
d2ea03a
Compare
… bucket_ownership_controls
Wrap Kafka tests in custom virtualenv SUMMARY aws_msk_config and aws_msk_cluster need recent versions of botocore, explicitly install these so we can still test against our minimum supported boto3/botocore versions ISSUE TYPE Bugfix Pull Request COMPONENT NAME aws_msk_config aws_msk_cluster ADDITIONAL INFORMATION fixes: ansible-collections#678 Reviewed-by: Markus Bergholz <[email protected]> Reviewed-by: Alina Buzachis <None> Reviewed-by: None <None>
…nce_refreshes_info.py
…stance_refreshes_info modules
Hi @danquixote, closing this (#487) duplicate PR as you have already opened another with changes and rebase done. #795 |
…equests (ansible-collections#487) ec2_spot_instance_info: add new module for describing spot instance requests SUMMARY Added a new module that describes the specified Spot Instance requests. ISSUE TYPE New Module Pull Request COMPONENT NAME ec2_spot_instance_info ADDITIONAL INFORMATION Related Documentation: https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSpotInstanceRequests Reviewed-by: Jill R <None> Reviewed-by: None <None>
SUMMARY
Resubmitting rebased-PR after initial review on #425 by @tremble .
Overview:
Adding the ec2_asg_instance_refresh and related *_info module. These modules are intended to be used together to start or cancel an EC2 AutoScaling Group (ASG) instance refresh, and then track the subsequent progress with the provided InstanceRefreshId. The *_info module can also be used to get multiple pages of refresh history using the NextToken.
Fixes #425
ISSUE TYPE
COMPONENT NAME
ec2_asg_instance_refresh
ec2_asg_instance_refreshes_info
ADDITIONAL INFORMATION