commit
8958e75496
1 changed files with 9 additions and 3 deletions
12
ec2_vol
12
ec2_vol
|
@ -49,18 +49,24 @@ options:
|
||||||
examples:
|
examples:
|
||||||
- code: 'local_action: ec2_vol instance=XXXXXX volume_size=5 device_name=sdd'
|
- code: 'local_action: ec2_vol instance=XXXXXX volume_size=5 device_name=sdd'
|
||||||
description: "Simple playbook example"
|
description: "Simple playbook example"
|
||||||
- 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 - attaching multiple volumes to multiple instances"
|
||||||
requirements: [ "boto" ]
|
requirements: [ "boto" ]
|
||||||
author: Lester Wade
|
author: Lester Wade
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
# Note: this module needs to be made idempotent. Possible solution is to use resource tags with the volumes.
|
||||||
|
# if state=present and it doesn't exist, create, tag and attach.
|
||||||
|
# Check for state by looking for volume attachment with tag (and against block device mapping?).
|
||||||
|
# Would personally like to revisit this in May when Eucalyptus also has tagging support (3.3).
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue