1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Add enumeration of block devices to ec2_block_devices

This commit is contained in:
Khushil Dep 2016-02-26 10:51:54 +00:00 committed by Daniel Malon
parent 28feba2fb3
commit 054e640fba
No known key found for this signature in database
GPG key ID: FCB97856BBA5B14D

View file

@ -37,6 +37,7 @@ When run against a specific host, this script returns the following variables:
- ec2_attachTime
- ec2_attachment
- ec2_attachmentId
- ec2_block_devices
- ec2_client_token
- ec2_deleteOnTermination
- ec2_description
@ -1323,6 +1324,10 @@ class Ec2Inventory(object):
group_names.append(group.name)
instance_vars["ec2_security_group_ids"] = ','.join([str(i) for i in group_ids])
instance_vars["ec2_security_group_names"] = ','.join([str(i) for i in group_names])
elif key == 'ec2_block_device_mapping':
instance_vars["ec2_block_devices"] = {}
for k, v in value.iteritems():
instance_vars["ec2_block_devices"][ ( k.split( '/' ) )[ -1 ] ] = v.volume_id
else:
pass
# TODO Product codes if someone finds them useful