# ec2\_vol is not mounting the filesystem

**URL:** <https://forum.ansible.com/t/ec2-vol-is-not-mounting-the-filesystem/18394>\
**Category:** Ansible Project\
**Created:** [June 3, 2015, 1:21pm UTC](https://forum.ansible.com/t/ec2-vol-is-not-mounting-the-filesystem/18394 "2015-06-03T13:21:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Igal\_Dahan](https://avatars.discourse-cdn.com/v4/letter/i/3bc359/32.png) [@Igal\_Dahan](https://forum.ansible.com/u/Igal_Dahan)\
**Post date:** [June 3, 2015, 1:21pm UTC](https://forum.ansible.com/t/ec2-vol-is-not-mounting-the-filesystem/18394/1 "2015-06-03T13:21:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![benno\_joy](https://avatars.discourse-cdn.com/v4/letter/b/73ab20/32.png) [@benno\_joy](https://forum.ansible.com/u/benno_joy)\
**Post date:** [June 3, 2015, 1:46pm UTC](https://forum.ansible.com/t/ec2-vol-is-not-mounting-the-filesystem/18394/2 "2015-06-03T13:46:36Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Igal\_Dahan](https://avatars.discourse-cdn.com/v4/letter/i/3bc359/32.png) [@Igal\_Dahan](https://forum.ansible.com/u/Igal_Dahan)\
**Post date:** [June 4, 2015, 11:36am UTC](https://forum.ansible.com/t/ec2-vol-is-not-mounting-the-filesystem/18394/3 "2015-06-04T11:36:15Z")

</div>

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
