-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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
Changes after rebase an already approved PR:24767 #40088
Conversation
When `tag_equality` is set true, use tags to determine if AMIs in different accounts are the same, and don't copy the AMI twice if they are the same. Use AnsibleAWSModule and make imports more consistent with other modules
version_added: "2.2" | ||
kms_key_id: | ||
description: | ||
- KMS key id used to encrypt image. If not specified, uses default EBS Customer Master Key (CMK) for your account. | ||
required: false | ||
default: null |
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 re-add these docs, as the default for any non-specified param is null
if module.params.get('wait'): | ||
delay = 15 | ||
ec2.get_waiter('image_available').wait(ImageIds=[image['ImageId']]) |
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 wait twice - the below lines do the same "wait" while respecting max wait time.
default: "default" | ||
description: | ||
description: | ||
- An optional human-readable string describing the contents and purpose of the new AMI. | ||
encrypted: | ||
description: | ||
- Whether or not the destination snapshots of the copied AMI should be encrypted. | ||
required: false |
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.
These lines should also be removed
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.
Removed them! Thanks @ryansb
|
||
module = AnsibleAWSModule(argument_spec=argument_spec) | ||
# TODO: Check botocore version | ||
region, ec2_url, aws_connect_params = get_aws_connection_info(module, boto3=True) | ||
ec2 = boto3_conn(module, conn_type='client', resource='ec2', region=region, endpoint=ec2_url, |
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, these 2 lines can be replaced with ec2 = module.client('ec2')
and the boto3_conn and get_aws_connection_info imports can be removed.
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.
Done! Thanks.
The test
The test
The test
The test
The test
The test
The test
The test
The test
The test
The test
The test
The test
The test
The test
The test
The test
The test
The test
The test
|
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.
Finished with the changes!
The test
The test
The test
The test
The test
The test
The test
The test
The test
The test
The test
The test
The test
The test
The test
The test
The test
The test
The test
The test
|
Thanks for your first contribution @rsubra13! |
…ible#40088) * Allow idempotent use of ec2_ami_copy When `tag_equality` is set true, use tags to determine if AMIs in different accounts are the same, and don't copy the AMI twice if they are the same. Use AnsibleAWSModule and make imports more consistent with other modules * Update version added * More code review changes * Review changes - Recommended way to start EC2 connection
…ible#40088) * Allow idempotent use of ec2_ami_copy When `tag_equality` is set true, use tags to determine if AMIs in different accounts are the same, and don't copy the AMI twice if they are the same. Use AnsibleAWSModule and make imports more consistent with other modules * Update version added * More code review changes * Review changes - Recommended way to start EC2 connection
…ible#40088) * Allow idempotent use of ec2_ami_copy When `tag_equality` is set true, use tags to determine if AMIs in different accounts are the same, and don't copy the AMI twice if they are the same. Use AnsibleAWSModule and make imports more consistent with other modules * Update version added * More code review changes * Review changes - Recommended way to start EC2 connection
…ible#40088) * Allow idempotent use of ec2_ami_copy When `tag_equality` is set true, use tags to determine if AMIs in different accounts are the same, and don't copy the AMI twice if they are the same. Use AnsibleAWSModule and make imports more consistent with other modules * Update version added * More code review changes * Review changes - Recommended way to start EC2 connection
…ible#40088) * Allow idempotent use of ec2_ami_copy When `tag_equality` is set true, use tags to determine if AMIs in different accounts are the same, and don't copy the AMI twice if they are the same. Use AnsibleAWSModule and make imports more consistent with other modules * Update version added * More code review changes * Review changes - Recommended way to start EC2 connection
SUMMARY
Rebase changes after an already approved PR:24767
ISSUE TYPE
COMPONENT NAME
ec2_ami_copy
ANSIBLE VERSION
ansible 2.5.2
ADDITIONAL INFORMATION
Nil