mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Added support for spot request type specification (to support persistent spot requests).
This commit is contained in:
parent
bd87c11c2a
commit
ed279d8175
1 changed files with 10 additions and 0 deletions
|
@ -75,6 +75,13 @@ options:
|
|||
required: false
|
||||
default: null
|
||||
aliases: []
|
||||
spot_type:
|
||||
description:
|
||||
- Type of spot request; one of "one-time" or "persistent". Defaults to "one-time" if not supplied.
|
||||
required: false
|
||||
default: "one-time"
|
||||
choices: [ "one-time", "persistent" ]
|
||||
aliases: []
|
||||
image:
|
||||
description:
|
||||
- I(ami) ID to use for the instance
|
||||
|
@ -759,6 +766,7 @@ def create_instances(module, ec2, vpc, override_count=None):
|
|||
instance_type = module.params.get('instance_type')
|
||||
tenancy = module.params.get('tenancy')
|
||||
spot_price = module.params.get('spot_price')
|
||||
spot_type = module.params.get('spot_type')
|
||||
image = module.params.get('image')
|
||||
if override_count:
|
||||
count = override_count
|
||||
|
@ -951,6 +959,7 @@ def create_instances(module, ec2, vpc, override_count=None):
|
|||
|
||||
params.update(dict(
|
||||
count = count_remaining,
|
||||
type = spot_type,
|
||||
))
|
||||
res = ec2.request_spot_instances(spot_price, **params)
|
||||
|
||||
|
@ -1179,6 +1188,7 @@ def main():
|
|||
zone = dict(aliases=['aws_zone', 'ec2_zone']),
|
||||
instance_type = dict(aliases=['type']),
|
||||
spot_price = dict(),
|
||||
spot_type = dict(default='one-time'),
|
||||
image = dict(),
|
||||
kernel = dict(),
|
||||
count = dict(type='int', default='1'),
|
||||
|
|
Loading…
Reference in a new issue