|
|
@ -36,30 +36,30 @@ options:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- identifier for this instance or set of instances, so that the module will be idempotent with respect to EC2 instances.
|
|
|
|
- identifier for this instance or set of instances, so that the module will be idempotent with respect to EC2 instances.
|
|
|
|
This identifier is valid for at least 24 hours after the termination of the instance, and should not be reused for another call later on.
|
|
|
|
This identifier is valid for at least 24 hours after the termination of the instance, and should not be reused for another call later on.
|
|
|
|
For details, see the description of client token at U(http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html).
|
|
|
|
For details, see the description of client token at U(https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html).
|
|
|
|
group:
|
|
|
|
group:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- security group (or list of groups) to use with the instance
|
|
|
|
- security group (or list of groups) to use with the instance.
|
|
|
|
aliases: [ 'groups' ]
|
|
|
|
aliases: [ 'groups' ]
|
|
|
|
group_id:
|
|
|
|
group_id:
|
|
|
|
version_added: "1.1"
|
|
|
|
version_added: "1.1"
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- security group id (or list of ids) to use with the instance
|
|
|
|
- security group id (or list of ids) to use with the instance.
|
|
|
|
region:
|
|
|
|
region:
|
|
|
|
version_added: "1.2"
|
|
|
|
version_added: "1.2"
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- The AWS region to use. Must be specified if ec2_url is not used.
|
|
|
|
- The AWS region to use. Must be specified if ec2_url is not used.
|
|
|
|
If not specified then the value of the EC2_REGION environment variable, if any, is used.
|
|
|
|
If not specified then the value of the EC2_REGION environment variable, if any, is used.
|
|
|
|
See U(http://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region)
|
|
|
|
See U(https://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region).
|
|
|
|
aliases: [ 'aws_region', 'ec2_region' ]
|
|
|
|
aliases: [ 'aws_region', 'ec2_region' ]
|
|
|
|
zone:
|
|
|
|
zone:
|
|
|
|
version_added: "1.2"
|
|
|
|
version_added: "1.2"
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- AWS availability zone in which to launch the instance
|
|
|
|
- AWS availability zone in which to launch the instance.
|
|
|
|
aliases: [ 'aws_zone', 'ec2_zone' ]
|
|
|
|
aliases: [ 'aws_zone', 'ec2_zone' ]
|
|
|
|
instance_type:
|
|
|
|
instance_type:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- instance type to use for the instance, see U(http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html)
|
|
|
|
- instance type to use for the instance, see U(https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html).
|
|
|
|
required: true
|
|
|
|
required: true
|
|
|
|
tenancy:
|
|
|
|
tenancy:
|
|
|
|
version_added: "1.9"
|
|
|
|
version_added: "1.9"
|
|
|
@ -81,14 +81,14 @@ options:
|
|
|
|
choices: [ "one-time", "persistent" ]
|
|
|
|
choices: [ "one-time", "persistent" ]
|
|
|
|
image:
|
|
|
|
image:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- I(ami) ID to use for the instance
|
|
|
|
- I(ami) ID to use for the instance.
|
|
|
|
required: true
|
|
|
|
required: true
|
|
|
|
kernel:
|
|
|
|
kernel:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- kernel I(eki) to use for the instance
|
|
|
|
- kernel I(eki) to use for the instance.
|
|
|
|
ramdisk:
|
|
|
|
ramdisk:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- ramdisk I(eri) to use for the instance
|
|
|
|
- ramdisk I(eri) to use for the instance.
|
|
|
|
wait:
|
|
|
|
wait:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- wait for the instance to reach its desired state before returning. Does not wait for SSH, see 'wait_for_connection' example for details.
|
|
|
|
- wait for the instance to reach its desired state before returning. Does not wait for SSH, see 'wait_for_connection' example for details.
|
|
|
@ -96,52 +96,52 @@ options:
|
|
|
|
default: 'no'
|
|
|
|
default: 'no'
|
|
|
|
wait_timeout:
|
|
|
|
wait_timeout:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- how long before wait gives up, in seconds
|
|
|
|
- how long before wait gives up, in seconds.
|
|
|
|
default: 300
|
|
|
|
default: 300
|
|
|
|
spot_wait_timeout:
|
|
|
|
spot_wait_timeout:
|
|
|
|
version_added: "1.5"
|
|
|
|
version_added: "1.5"
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- how long to wait for the spot instance request to be fulfilled
|
|
|
|
- how long to wait for the spot instance request to be fulfilled.
|
|
|
|
default: 600
|
|
|
|
default: 600
|
|
|
|
count:
|
|
|
|
count:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- number of instances to launch
|
|
|
|
- number of instances to launch.
|
|
|
|
default: 1
|
|
|
|
default: 1
|
|
|
|
monitoring:
|
|
|
|
monitoring:
|
|
|
|
version_added: "1.1"
|
|
|
|
version_added: "1.1"
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- enable detailed monitoring (CloudWatch) for instance
|
|
|
|
- enable detailed monitoring (CloudWatch) for instance.
|
|
|
|
type: bool
|
|
|
|
type: bool
|
|
|
|
default: 'no'
|
|
|
|
default: 'no'
|
|
|
|
user_data:
|
|
|
|
user_data:
|
|
|
|
version_added: "0.9"
|
|
|
|
version_added: "0.9"
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- opaque blob of data which is made available to the ec2 instance
|
|
|
|
- opaque blob of data which is made available to the ec2 instance.
|
|
|
|
instance_tags:
|
|
|
|
instance_tags:
|
|
|
|
version_added: "1.0"
|
|
|
|
version_added: "1.0"
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- a hash/dictionary of tags to add to the new instance or for starting/stopping instance by tag; '{"key":"value"}' and '{"key":"value","key":"value"}'
|
|
|
|
- a hash/dictionary of tags to add to the new instance or for starting/stopping instance by tag; '{"key":"value"}' and '{"key":"value","key":"value"}'.
|
|
|
|
placement_group:
|
|
|
|
placement_group:
|
|
|
|
version_added: "1.3"
|
|
|
|
version_added: "1.3"
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- placement group for the instance when using EC2 Clustered Compute
|
|
|
|
- placement group for the instance when using EC2 Clustered Compute.
|
|
|
|
vpc_subnet_id:
|
|
|
|
vpc_subnet_id:
|
|
|
|
version_added: "1.1"
|
|
|
|
version_added: "1.1"
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- the subnet ID in which to launch the instance (VPC)
|
|
|
|
- the subnet ID in which to launch the instance (VPC).
|
|
|
|
assign_public_ip:
|
|
|
|
assign_public_ip:
|
|
|
|
version_added: "1.5"
|
|
|
|
version_added: "1.5"
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- when provisioning within vpc, assign a public IP address. Boto library must be 2.13.0+
|
|
|
|
- when provisioning within vpc, assign a public IP address. Boto library must be 2.13.0+.
|
|
|
|
type: bool
|
|
|
|
type: bool
|
|
|
|
private_ip:
|
|
|
|
private_ip:
|
|
|
|
version_added: "1.2"
|
|
|
|
version_added: "1.2"
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- the private ip address to assign the instance (from the vpc subnet)
|
|
|
|
- the private ip address to assign the instance (from the vpc subnet).
|
|
|
|
instance_profile_name:
|
|
|
|
instance_profile_name:
|
|
|
|
version_added: "1.3"
|
|
|
|
version_added: "1.3"
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- Name of the IAM instance profile (i.e. what the EC2 console refers to as an "IAM Role") to use. Boto library must be 2.5.0+
|
|
|
|
- Name of the IAM instance profile (i.e. what the EC2 console refers to as an "IAM Role") to use. Boto library must be 2.5.0+.
|
|
|
|
instance_ids:
|
|
|
|
instance_ids:
|
|
|
|
version_added: "1.3"
|
|
|
|
version_added: "1.3"
|
|
|
|
description:
|
|
|
|
description:
|
|
|
@ -156,13 +156,13 @@ options:
|
|
|
|
termination_protection:
|
|
|
|
termination_protection:
|
|
|
|
version_added: "2.0"
|
|
|
|
version_added: "2.0"
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- Enable or Disable the Termination Protection
|
|
|
|
- Enable or Disable the Termination Protection.
|
|
|
|
type: bool
|
|
|
|
type: bool
|
|
|
|
default: 'no'
|
|
|
|
default: 'no'
|
|
|
|
instance_initiated_shutdown_behavior:
|
|
|
|
instance_initiated_shutdown_behavior:
|
|
|
|
version_added: "2.2"
|
|
|
|
version_added: "2.2"
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- Set whether AWS will Stop or Terminate an instance on shutdown. This parameter is ignored when using instance-store
|
|
|
|
- Set whether AWS will Stop or Terminate an instance on shutdown. This parameter is ignored when using instance-store.
|
|
|
|
images (which require termination on shutdown).
|
|
|
|
images (which require termination on shutdown).
|
|
|
|
default: 'stop'
|
|
|
|
default: 'stop'
|
|
|
|
choices: [ "stop", "terminate" ]
|
|
|
|
choices: [ "stop", "terminate" ]
|
|
|
@ -184,7 +184,7 @@ options:
|
|
|
|
ebs_optimized:
|
|
|
|
ebs_optimized:
|
|
|
|
version_added: "1.6"
|
|
|
|
version_added: "1.6"
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- whether instance is using optimized EBS volumes, see U(http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSOptimized.html)
|
|
|
|
- whether instance is using optimized EBS volumes, see U(https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSOptimized.html).
|
|
|
|
default: 'no'
|
|
|
|
default: 'no'
|
|
|
|
exact_count:
|
|
|
|
exact_count:
|
|
|
|
version_added: "1.5"
|
|
|
|
version_added: "1.5"
|
|
|
@ -207,7 +207,7 @@ options:
|
|
|
|
spot_launch_group:
|
|
|
|
spot_launch_group:
|
|
|
|
version_added: "2.1"
|
|
|
|
version_added: "2.1"
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- Launch group for spot request, see U(http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/how-spot-instances-work.html#spot-launch-group)
|
|
|
|
- Launch group for spot request, see U(https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/how-spot-instances-work.html#spot-launch-group).
|
|
|
|
|
|
|
|
|
|
|
|
author:
|
|
|
|
author:
|
|
|
|
- "Tim Gerla (@tgerla)"
|
|
|
|
- "Tim Gerla (@tgerla)"
|
|
|
@ -858,7 +858,7 @@ def await_spot_requests(module, ec2, spot_requests, count):
|
|
|
|
# price, or group constraints in this case, we'll fail
|
|
|
|
# price, or group constraints in this case, we'll fail
|
|
|
|
# the module if the reason for the state is anything
|
|
|
|
# the module if the reason for the state is anything
|
|
|
|
# other than termination by user. Codes are documented at
|
|
|
|
# other than termination by user. Codes are documented at
|
|
|
|
# http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-bid-status.html
|
|
|
|
# https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-bid-status.html
|
|
|
|
if sir.status.code == 'instance-terminated-by-user':
|
|
|
|
if sir.status.code == 'instance-terminated-by-user':
|
|
|
|
# do nothing, since the user likely did this on purpose
|
|
|
|
# do nothing, since the user likely did this on purpose
|
|
|
|
pass
|
|
|
|
pass
|
|
|
|