Updated comments and closed code example.

reviewable/pr18780/r1
lwade 12 years ago
parent 485af927c5
commit 4c138ba91b

@ -24,19 +24,19 @@ version_added: "1.1"
options: options:
instance: instance:
description: description:
- instance ID - instance ID if you wish to attach the volume.
required: false required: false
default: null default: null
aliases: [] aliases: []
volume_size: volume_size:
description: description:
- size of volume (in GB) - size of volume (in GB) to create.
required: true required: true
default: null default: null
aliases: [] aliases: []
device_name: device_name:
description: description:
- device id to override device mapping. Normally /dev/sdf for instance-store, /dev/sdb for EBS. - device id to override device mapping. Assumes /dev/sdf for instance-store, /dev/sdb for EBS.
required: false required: false
default: null default: null
aliases: [] aliases: []
@ -52,11 +52,10 @@ examples:
- code: '- name: Launch instances - code: '- name: Launch instances
local_action: ec2 keypair=$keypair image=$image wait=true count=3 local_action: ec2 keypair=$keypair image=$image wait=true count=3
register: ec2 register: ec2
- name: Create volumes and attach - name: Create volumes and attach
local_action: ec2_vol instance=${item.id} volume_size=5 local_action: ec2_vol instance=${item.id} volume_size=5
with_items: ${ec2.instances} with_items: ${ec2.instances}
register: ec2_vol register: ec2_vol'
description: "Advanced playbook example" description: "Advanced playbook example"
requirements: [ "boto" ] requirements: [ "boto" ]
author: Lester Wade author: Lester Wade
@ -142,6 +141,9 @@ def main():
# If device_name isn't set, make a choice based on best practices here: # If device_name isn't set, make a choice based on best practices here:
# http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html # http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html
# In future this needs to be more dynamic but combining block device mapping best practices
# (bounds for devices, as above) with instance.block_device_mapping data would be tricky. For me ;)
if device_name is None and instance: if device_name is None and instance:
try: try:
if inst.root_device_type != 'ebs': if inst.root_device_type != 'ebs':

Loading…
Cancel
Save