diff options
author | Toshio Kuratomi <a.badger@gmail.com> | 2016-09-27 07:47:41 -0700 |
---|---|---|
committer | Toshio Kuratomi <a.badger@gmail.com> | 2016-09-27 07:47:41 -0700 |
commit | 335d3315581d4b59137809b09b4edd7a850a706f (patch) | |
tree | 3a6c668346b162eee46a112a544e897db7f1602e | |
parent | a965d84f8d468531aa0c4e785ae0a3586a3d3e2d (diff) | |
download | ansible-modules-core-335d3315581d4b59137809b09b4edd7a850a706f.tar.gz |
Fix mount backport
-rw-r--r-- | system/mount.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/system/mount.py b/system/mount.py index 7076d9fa..0428a9eb 100644 --- a/system/mount.py +++ b/system/mount.py @@ -351,6 +351,7 @@ def is_bind_mounted(module, dest, src=None, fstype=None): arguments = mnt.split() if get_platform().lower() == 'linux': + source = arguments[1] result = mount_pattern.search(arguments[1]) # This is only for LVM and tmpfs mounts @@ -361,6 +362,18 @@ def is_bind_mounted(module, dest, src=None, fstype=None): # That's for unmounted/absent if arguments[0] == dest: is_mounted = True + else: + # That's for mounted + if arguments[0] == dest and source == src: + is_mounted = True + elif arguments[0] == dest and src.endswith(source): + # Check if it's tmpfs mount + sub_path = src[:len(src)-len(source)] + + if ( + is_bind_mounted(module, sub_path, 'tmpfs') and + source == src[len(sub_path):]): + is_mounted = True elif ( (arguments[0] == src or src is None) and arguments[2] == dest and |