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

aws_access_key
    AWS access key. If not set then the value of the AWS_ACCESS_KEY environment variable is used. (default: None)

aws_secret_key
    AWS secret key. If not set then the value of the AWS_SECRET_KEY environment variable is used. (default: None)

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

ec2_url
    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

instance
    instance ID if you wish to attach the volume.

iops
    the provisioned IOPs you want to associate with this volume (integer). (default: 100)(Added in Ansible version 1.3.)

region
    The AWS region to use. If not specified then the value of the EC2_REGION environment variable, if any, is used.

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
    # Example using custom iops params
    - local_action:
        module: ec2_vol
        instance: XXXXXX
        volume_size: 5
        iops: 200
        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