Merge pull request #2211 from kai11/feature/spot_launch_group

Added launch group support for ec2 module
This commit is contained in:
Brian Coca 2015-11-23 09:31:33 -08:00
commit b789db7b9d

View file

@ -247,6 +247,13 @@ options:
required: false
default: null
aliases: ['network_interface']
spot_launch_group:
version_added: "2.0"
description:
- Launch group for spot request, see U(http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/how-spot-instances-work.html#spot-launch-group)
required: false
default: null
aliases: []
author:
- "Tim Gerla (@tgerla)"
@ -358,6 +365,7 @@ EXAMPLES = '''
wait: yes
vpc_subnet_id: subnet-29e63245
assign_public_ip: yes
spot_launch_group: report_generators
# Examples using pre-existing network interfaces
- ec2:
@ -860,6 +868,7 @@ def create_instances(module, ec2, vpc, override_count=None):
source_dest_check = module.boolean(module.params.get('source_dest_check'))
termination_protection = module.boolean(module.params.get('termination_protection'))
network_interfaces = module.params.get('network_interfaces')
spot_launch_group = module.params.get('spot_launch_group')
# group_id and group_name are exclusive of each other
if group_id and group_name:
@ -1042,6 +1051,9 @@ def create_instances(module, ec2, vpc, override_count=None):
module.fail_json(
msg="placement_group parameter requires Boto version 2.3.0 or higher.")
if spot_launch_group and isinstance(spot_launch_group, basestring):
params['launch_group'] = spot_launch_group
params.update(dict(
count = count_remaining,
type = spot_type,
@ -1310,6 +1322,7 @@ def main():
instance_type = dict(aliases=['type']),
spot_price = dict(),
spot_type = dict(default='one-time', choices=["one-time", "persistent"]),
spot_launch_group = dict(),
image = dict(),
kernel = dict(),
count = dict(type='int', default='1'),