mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Added some block_device_mapping (disks) informations to EC2 instance module ouput
This commit is contained in:
parent
a8da674cf4
commit
ae1080d922
1 changed files with 13 additions and 0 deletions
|
@ -624,6 +624,19 @@ def get_instance_info(inst):
|
|||
except AttributeError:
|
||||
instance_info['ebs_optimized'] = False
|
||||
|
||||
try:
|
||||
bdm_dict = {}
|
||||
bdm = getattr(inst, 'block_device_mapping')
|
||||
for device_name in bdm.keys():
|
||||
bdm_dict[device_name] = {
|
||||
'status': bdm[device_name].status,
|
||||
'volume_id': bdm[device_name].volume_id,
|
||||
'delete_on_termination': bdm[device_name].delete_on_termination
|
||||
}
|
||||
instance_info['block_device_mapping'] = bdm_dict
|
||||
except AttributeError:
|
||||
instance_info['block_device_mapping'] = False
|
||||
|
||||
try:
|
||||
instance_info['tenancy'] = getattr(inst, 'placement_tenancy')
|
||||
except AttributeError:
|
||||
|
|
Loading…
Reference in a new issue