Skip to content
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

Handle ec2_vol.tags when the associated instance already exists #1071

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Retrieve existing tags when tags set is None
  • Loading branch information
GomathiselviS committed Sep 28, 2022
commit 7b42ee8f686cee86f3fda20d1adefc339887a455
4 changes: 1 addition & 3 deletions plugins/modules/ec2_vol.py
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,6 @@ def main():
mapped_device = get_mapped_block_device(instance_dict=inst, device_name=device_name)
if mapped_device:
other_volume_mapped = False

if volume:
if volume['volume_id'] != mapped_device['ebs']['volume_id']:
other_volume_mapped = True
Expand All @@ -822,12 +821,11 @@ def main():

final_tags = None
tags_changed = False

if volume:
volume, changed = update_volume(module, ec2_conn, volume)
if name:
if not tags:
tags = {}
tags = boto3_tag_list_to_ansible_dict(volume.get('tags'))
tags['Name'] = name
final_tags, tags_changed = ensure_tags(module, ec2_conn, volume['volume_id'], 'volume', tags, module.params.get('purge_tags'))
else:
Expand Down