I’m trying to add ebs optimized support to the ec2 module. My diff file for my naive first pass against devel is below. When I try and test this, I consistent get the following error:
failed: [localhost] => {“failed”: true}
msg: dictionary requested, could not parse JSON or key=value
FATAL: all hosts have already failed – aborting
The playbook runs just fine without the ebs_optimized: yes stanza.
I’m clearly missing something, but what?
diff --git a/library/cloud/ec2 b/library/cloud/ec2
index 5945d93…bac9c1c 100644
— a/library/cloud/ec2
+++ b/library/cloud/ec2
@@ -184,6 +184,12 @@ options:
required: false
default: ‘present’
aliases:
- ebs_optimized:
- version_added: “1.X”
- description:
-
- Support IOPS optimized instances
- default: null
- aliases:
requirements: [ “boto” ]
author: Seth Vidal, Tim Gerla, Lester Wade
@@ -323,6 +329,7 @@ def get_instance_info(inst):
‘placement’: inst.placement,
‘kernel’: inst.kernel,
‘ramdisk’: inst.ramdisk,
- ‘ebs_optimized’: inst.ebs_optimized,
‘launch_time’: inst.launch_time,
‘instance_type’: inst.instance_type,
‘root_device_type’: inst.root_device_type,
@@ -380,6 +387,7 @@ def create_instances(module, ec2):
vpc_subnet_id = module.params.get(‘vpc_subnet_id’)
private_ip = module.params.get(‘private_ip’)
instance_profile_name = module.params.get(‘instance_profile_name’) - ebs_optimized = module.params.get(‘ebs_optimized’)
group_id and group_name are exclusive of each other
@@ -442,7 +450,8 @@ def create_instances(module, ec2):
‘ramdisk_id’: ramdisk,
‘subnet_id’: vpc_subnet_id,
‘private_ip_address’: private_ip,
- ‘user_data’: user_data}
- ‘user_data’: user_data,
- ‘ebs_optimized’: ebs_optimized}
if boto_supports_profile_name_arg(ec2):
params[‘instance_profile_name’] = instance_profile_name
@@ -607,6 +616,7 @@ def main():
instance_profile_name = dict(),
instance_ids = dict(type=‘list’),
state = dict(default=‘present’),
- ebs_optimized = dict(type=‘bool’, default=False),
)
)