- 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.
required: false
required: false
default: null
default: null
aliases: []
aliases: [ 'aws_region', 'ec2_region' ]
zone:
zone:
version_added: "1.2"
version_added: "1.2"
description:
description:
- availability zone in which to launch the instance
- AWS availability zone in which to launch the instance
required: false
required: false
default: null
default: null
aliases: []
aliases: [ 'aws_zone', 'ec2_zone' ]
instance_type:
instance_type:
description:
description:
- instance type to use for the instance
- instance type to use for the instance
@ -99,22 +99,22 @@ options:
aliases: []
aliases: []
ec2_url:
ec2_url:
description:
description:
- url to use to connect to EC2 or your Eucalyptus cloud (by default the module will use EC2 endpoints)
- Url to use to connect to EC2 or your Eucalyptus cloud (by default the module will use EC2 endpoints). Must be specified if region is not used. If not set then the value of the EC2_URL environment variable, if any, is used
required: false
required: false
default: null
default: null
aliases: []
aliases: []
ec2_secret_key:
aws_secret_key:
description:
description:
- EC2 secret key. If not specified then the EC2_SECRET_KEY environment variable is used.
- AWS secret key. If not set then the value of the AWS_SECRET_KEY environment variable is used.
required: false
required: false
default: null
default: null
aliases: [ EC2_SECRET_KEY ]
aliases: [ 'ec2_secret_key', 'secret_key' ]
ec2_access_key:
aws_access_key:
description:
description:
- EC2 access key. If not specified then the EC2_ACCESS_KEY environment variable is used.
- AWS access key. If not set then the value of the AWS_ACCESS_KEY environment variable is used.
- url to use to connect to EC2 or your Eucalyptus cloud (by default the module will use EC2 endpoints)
- Url to use to connect to EC2 or your Eucalyptus cloud (by default the module will use EC2 endpoints). Must be specified if region is not used. If not set then the value of the EC2_URL environment variable, if any, is used
required: false
required: false
default: null
default: null
aliases: []
aliases: []
ec2_secret_key:
aws_secret_key:
description:
description:
- ec2 secret key
- AWS secret key. If not set then the value of the AWS_SECRET_KEY environment variable is used.
required: false
required: false
default: null
default: null
aliases: []
aliases: [ 'ec2_secret_key', 'secret_key' ]
ec2_access_key:
aws_access_key:
description:
description:
- ec2 access key
- AWS access key. If not set then the value of the AWS_ACCESS_KEY environment variable is used.
required: false
required: false
default: null
default: null
aliases: []
aliases: ['ec2_access_key', 'access_key' ]
instance_id:
instance_id:
description:
description:
- instance id of the image to create
- instance id of the image to create
@ -71,10 +71,10 @@ options:
aliases: []
aliases: []
region:
region:
description:
description:
- the EC2 region to use
- 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.
required: false
required: false
default: null
default: null
aliases: []
aliases: [ 'aws_region', 'ec2_region' ]
description:
description:
description:
description:
- An optional human-readable string describing the contents and purpose of the AMI.
- An optional human-readable string describing the contents and purpose of the AMI.
- creates an EBS volume and optionally attaches it to an instance. If both an instance ID and a device name is given and the instance has a device at the device name, then no volume is created and no attachment is made. This module has a dependency on python-boto.
- creates an EBS volume and optionally attaches it to an instance. If both an instance ID and a device name is given and the instance has a device at the device name, then no volume is created and no attachment is made. This module has a dependency on python-boto.
version_added: "1.1"
version_added: "1.1"
options:
options:
aws_secret_key:
description:
- AWS secret key. If not set then the value of the AWS_SECRET_KEY environment variable is used.
required: false
default: None
aliases: ['ec2_secret_key', 'secret_key' ]
aws_access_key:
description:
- AWS access key. If not set then the value of the AWS_ACCESS_KEY environment variable is used.
required: false
default: None
aliases: ['ec2_access_key', 'access_key' ]
ec2_url:
description:
- Url to use to connect to EC2 or your Eucalyptus cloud (by default the module will use EC2 endpoints). Must be specified if region is not used. If not set then the value of the EC2_URL environment variable, if any, is used
required: false
default: null
aliases: []
instance:
instance:
description:
description:
- instance ID if you wish to attach the volume.
- instance ID if you wish to attach the volume.
@ -49,16 +67,16 @@ options:
aliases: []
aliases: []
region:
region:
description:
description:
- region in which to create the volume
- The AWS region to use. If not specified then the value of the EC2_REGION environment variable, if any, is used.
required: false
required: false
default: null
default: null
aliases: []
aliases: ['aws_region', 'ec2_region']
zone:
zone:
description:
description:
- zone in which to create the volume, if unset uses the zone the instance is in (if set)
- zone in which to create the volume, if unset uses the zone the instance is in (if set)
required: false
required: false
default: null
default: null
aliases: []
aliases: ['aws_zone', 'ec2_zone']
requirements: [ "boto" ]
requirements: [ "boto" ]
author: Lester Wade
author: Lester Wade
'''
'''
@ -109,6 +127,15 @@ except ImportError:
print "failed=True msg='boto required for this module'"
print "failed=True msg='boto required for this module'"
sys.exit(1)
sys.exit(1)
AWS_REGIONS = ['ap-northeast-1',
'ap-southeast-1',
'ap-southeast-2',
'eu-west-1',
'sa-east-1',
'us-east-1',
'us-west-1',
'us-west-2']
def main():
def main():
module = AnsibleModule(
module = AnsibleModule(
argument_spec = dict(
argument_spec = dict(
@ -116,11 +143,11 @@ def main():
volume_size = dict(required=True),
volume_size = dict(required=True),
iops = dict(),
iops = dict(),
device_name = dict(),
device_name = dict(),
region = dict(),
region = dict(aliases=['aws_region', 'ec2_region'], choices=AWS_REGIONS),
zone = dict(),
zone = dict(aliases=['availability_zone', 'aws_zone', 'ec2_zone']),
- the EC2 region to use. If not specified then the EC2_REGION environment variable is used. If neither exist then the AWS is queried for the region that the host invoking the module is located in.
- The AWS region to use. If not specified then the value of the EC2_REGION environment variable, if any, is used.
required: true
required: true
default: null
default: null
aliases: []
aliases: [ 'aws_region', 'ec2_region' ]
db_name:
db_name:
description:
description:
- Name of a database to create within the instance. If not specified then no database is created. Used only when command=create.
- Name of a database to create within the instance. If not specified then no database is created. Used only when command=create.
@ -165,7 +165,7 @@ options:
- availability zone in which to launch the instance. Used only when command=create or command=replicate.
- availability zone in which to launch the instance. Used only when command=create or command=replicate.
required: false
required: false
default: null
default: null
aliases: []
aliases: ['aws_zone', 'ec2_zone']
subnet:
subnet:
description:
description:
- VPC subnet group. If specified then a VPC instance is created. Used only when command=create.
- VPC subnet group. If specified then a VPC instance is created. Used only when command=create.
@ -178,18 +178,18 @@ options:
required: false
required: false
default: null
default: null
aliases: []
aliases: []
ec2_secret_key:
aws_secret_key:
description:
description:
- EC2 secret key. If not specified then the EC2_SECRET_KEY environment variable is used.
- AWS secret key. If not set then the value of the AWS_SECRET_KEY environment variable is used.
required: false
required: false
default: null
default: null
aliases: []
aliases: [ 'ec2_secret_key', 'secret_key' ]
ec2_access_key:
aws_access_key:
description:
description:
- EC2 access key. If not specified then the EC2_ACCESS_KEY environment variable is used.
- AWS access key. If not set then the value of the AWS_ACCESS_KEY environment variable is used.
required: false
required: false
default: null
default: null
aliases: []
aliases: [ 'ec2_access_key', 'access_key' ]
wait:
wait:
description:
description:
- When command=create, replicate, or modify then wait for the database to enter the 'available' state. When command=delete wait for the database to be terminated.
- When command=create, replicate, or modify then wait for the database to enter the 'available' state. When command=delete wait for the database to be terminated.
@ -263,12 +263,6 @@ except ImportError:
print "failed=True msg='boto required for this module'"
print "failed=True msg='boto required for this module'"
sys.exit(1)
sys.exit(1)
try:
import urllib2
except ImportError:
print "failed=True msg='urllib2 required for this module'"