|
|
@ -52,20 +52,32 @@ options:
|
|
|
|
required: false
|
|
|
|
required: false
|
|
|
|
default: null
|
|
|
|
default: null
|
|
|
|
aliases: []
|
|
|
|
aliases: []
|
|
|
|
examples:
|
|
|
|
requirements: [ "boto" ]
|
|
|
|
- code: 'local_action: ec2_vol instance=XXXXXX volume_size=5 device_name=sdd'
|
|
|
|
author: Lester Wade
|
|
|
|
description: "Simple playbook example"
|
|
|
|
'''
|
|
|
|
- code: |
|
|
|
|
|
|
|
|
- name: Launch instances
|
|
|
|
EXAMPLES = '''
|
|
|
|
local_action: ec2 keypair=$keypair image=$image wait=yes count=3
|
|
|
|
# Simple attachment action
|
|
|
|
|
|
|
|
local_action:
|
|
|
|
|
|
|
|
module: ec2_vol
|
|
|
|
|
|
|
|
instance: XXXXXX
|
|
|
|
|
|
|
|
volume_size: 5
|
|
|
|
|
|
|
|
device_name: sdd
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Playbook example combined with instance launch
|
|
|
|
|
|
|
|
local_action:
|
|
|
|
|
|
|
|
module: ec2
|
|
|
|
|
|
|
|
keypair: $keypair
|
|
|
|
|
|
|
|
image: $image
|
|
|
|
|
|
|
|
wait: yes
|
|
|
|
|
|
|
|
count: 3
|
|
|
|
register: ec2
|
|
|
|
register: ec2
|
|
|
|
- name: Create volumes and attach
|
|
|
|
local_action:
|
|
|
|
local_action: ec2_vol instance=${item.id} volume_size=5
|
|
|
|
module: ec2_vol
|
|
|
|
|
|
|
|
instance: ${item.id}
|
|
|
|
|
|
|
|
volume_size: 5
|
|
|
|
with_items: ${ec2.instances}
|
|
|
|
with_items: ${ec2.instances}
|
|
|
|
register: ec2_vol
|
|
|
|
register: ec2_vol
|
|
|
|
description: "Advanced - attaching multiple volumes to multiple instances"
|
|
|
|
|
|
|
|
requirements: [ "boto" ]
|
|
|
|
|
|
|
|
author: Lester Wade
|
|
|
|
|
|
|
|
'''
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
|
|
|
# Note: this module needs to be made idempotent. Possible solution is to use resource tags with the volumes.
|
|
|
|
# Note: this module needs to be made idempotent. Possible solution is to use resource tags with the volumes.
|
|
|
|