ec2_vol is not mounting the filesystem

Hi

I have created playbook which i can provision ec2 instance and create volume to that ec2 instance but when i am connected into the instance the volume is not recognized and seems not partitioned and thus not mounted.

my questions are:

is the ec2_vol create or attach are partitioning and mounting the new volume ?
if yes why its not, the playbook is listed below?
if not what should it in order to automatically mounting it ?

  • name: Launch instances
    local_action:
    module: ec2
    image: “{{ image }}”
    instance_type: “{{ instance_type }}”
    keypair: “{{ keypair }}”
    instance_tags: ‘{ “Name”:“{{ hostname }}” , “Group”:“couchbase” }’
    region: “{{ region }}”
    group: “{{ group }}”
    zone: “{{ zone }}”
    wait: “true”
    #wait_timeout: 500
    spot_wait_timeout: 300
    count: “{{count}}”
    volumes:

  • device_name: /dev/xvda
    volume_size: “{{volume_size}}”
    register: ec2

  • name: Create Volume
    local_action:
    module: ec2_vol
    instance: “{{ item.id }}”
    #id: “{{volume_id}}”
    #device_name: “/dev/xvdf”
    region: “{{ region }}”
    zone: “{{ zone }}”
    volume_size: 10
    volume_type: “gp2”
    with_items: ec2.instances
    register: ec2_vol

  • name: Attach Volume

local_action:
module: ec2_vol
id: “{{item.volume_id}}”
region: “{{ region }}”
zone: “{{ zone }}”
with_items: ec2_vol.results
register: ec2_vol

Hi,

Curretly the ec2_vol module only supoprts creating a new volume and attaching it to an instance. It doesnt partition them and mount them.
probably you should use modules like 'lvg,lvol,filesystem and mount" to get the other things in place.

Thanks a lot

yes i used mkfs and mount for new fs in include task file and command shell for resize2fs for resizing existing one

Igal