# mount module

**URL:** <https://forum.ansible.com/t/mount-module/17924>\
**Category:** Ansible Developer\
**Created:** [April 8, 2015, 2:57am UTC](https://forum.ansible.com/t/mount-module/17924 "2015-04-08T02:57:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeffrey\_Lageweg](https://avatars.discourse-cdn.com/v4/letter/j/a9a28c/32.png) [@Jeffrey\_Lageweg](https://forum.ansible.com/u/Jeffrey_Lageweg)\
**Post date:** [April 8, 2015, 2:57am UTC](https://forum.ansible.com/t/mount-module/17924/1 "2015-04-08T02:57:39Z")

</div>

Hi there,

I saw that the Ansible mount module has some issues, when i defined the fstab argument.

For example:  
When I define an argument fstab (/tmp/fstab) and place the state on mounted. My mount point is /data/archive

The mount entry is placed in the custom fstab file and the mount is called with arguments:  
mount /data/archive  
and this resulted in error:

msg: Error mounting /data/archive: mount: can’t find /data/archive in /etc/fstab

This would mean that the mount command is called without the custom fstab file.  
I check the source and i suggest these adjustments.

diff --git a/system/mount.py b/system/mount.py

index 9dc6fbe…4cb9b85 100644

— a/system/mount.py

+++ b/system/mount.py

@@ -209,10 +209,11 @@ def mount(module, \*\*kwargs):

mount\_bin = module.get\_bin\_path(‘mount’)

name = kwargs[‘name’]

- fstab = kwargs[‘fstab’]

if os.path.ismount(name):

- cmd = [mount\_bin , ‘-o’, ‘remount’, name]

- cmd = [mount\_bin , ‘-T’, fstab, ‘-o’, ‘remount’, name]

else:

- cmd = [mount\_bin, name]

- cmd = [mount\_bin, ‘-T’, fstab, name]

rc, out, err = module.run\_command(cmd)

if rc == 0:
