From 886a71e8eb50cb6783845765b55594187e9bad4e Mon Sep 17 00:00:00 2001 From: lwade Date: Mon, 17 Jun 2013 14:35:53 +0100 Subject: [PATCH] Added placement_group parameter for cluster compute. --- library/cloud/ec2 | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/library/cloud/ec2 b/library/cloud/ec2 index 90dcd833b3..fbcb2d018d 100644 --- a/library/cloud/ec2 +++ b/library/cloud/ec2 @@ -142,6 +142,13 @@ options: required: false default: null aliases: [] + placement_group: + version_added: "1.3" + description: + - placement group for the instance when using EC2 Clustered Compute + required: false + default: null + aliases: [] vpc_subnet_id: version_added: "1.1" description: @@ -223,6 +230,7 @@ def main(): ec2_url = dict(aliases=['EC2_URL']), ec2_secret_key = dict(aliases=['EC2_SECRET_KEY'], no_log=True), ec2_access_key = dict(aliases=['EC2_ACCESS_KEY']), + placement_group = dict(), user_data = dict(), instance_tags = dict(), vpc_subnet_id = dict(), @@ -247,6 +255,7 @@ def main(): ec2_url = module.params.get('ec2_url') ec2_secret_key = module.params.get('ec2_secret_key') ec2_access_key = module.params.get('ec2_access_key') + placement_group = module.params.get('placement_group') user_data = module.params.get('user_data') instance_tags = module.params.get('instance_tags') vpc_subnet_id = module.params.get('vpc_subnet_id') @@ -310,7 +319,6 @@ def main(): count_remaining = count_remaining - len(running_instances) # Both min_count and max_count equal count parameter. This means the launch request is explicit (we want count, or fail) in how many instances we want. - if count_remaining > 0: try: @@ -320,7 +328,8 @@ def main(): 'min_count': count_remaining, 'max_count': count_remaining, 'monitoring_enabled': monitoring, - 'placement': zone, + 'placement': zone, + 'placement_group': placement_group, 'instance_type': instance_type, 'kernel_id': kernel, 'ramdisk_id': ramdisk,