ANSIBLE.EC2_VOL(3)

NAME
ec2_vol - create and attach a volume, return volume id and device map

DESCRIPTION

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.

OPTIONS

device_name
    device id to override device mapping. Assumes /dev/sdf for Linux/UNIX and /dev/xvdf for Windows.

instance
    instance ID if you wish to attach the volume.

region
    region in which to create the volume

volume_size
    size of volume (in GB) to create.(required)

zone
    zone in which to create the volume, if unset uses the zone the instance is in (if set)."
    # 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
    local_action:
        module: ec2_vol
        instance: ${item.id}
        volume_size: 5
        with_items: ${ec2.instances}
        register: ec2_vol

AUTHOR
Lester Wade

SEE ALSO
ansible(1), http://ansible.github.com/modules.html#ec2-vol