From 4b29389bd0dc874efc6d54f4d42044c885ae457d Mon Sep 17 00:00:00 2001 From: "Alexander E. Patrakov" Date: Mon, 16 Dec 2019 10:42:02 +0500 Subject: [PATCH] Partially revert "mount: Check if src exists before mounted (ansible/ansible#61752)" This reverts part of ansible commit 72023d7462e78635264fd12bfdb23894b4163cba. The immediate reason is that it breaks mounts where src is not a path. Examples of such mounts are network-based filesystems such as nfs, cifs, glusterfs, ceph, virtual filesystems such as tmpfs or overlayfs, and also UUID-based mounts. It is too hard to come with an exhaustive list, especially if we take non-Linux systems into account, so don't even try. Additionally, it did not really fix the issue (ansible/ansible#59183) that it intended to fix, because the mount could fail but leave a non-working fstab entry for reasons other than non-existing src path. Fixes: ansible/ansible#65855 Fixes: ansible/ansible#67588 Fixes: ansible/ansible#67966 --- plugins/modules/mount.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/plugins/modules/mount.py b/plugins/modules/mount.py index b9be7f9..3da1dc0 100644 --- a/plugins/modules/mount.py +++ b/plugins/modules/mount.py @@ -716,9 +716,6 @@ def main(): changed = True elif state == 'mounted': - if not os.path.exists(args['src']): - module.fail_json(msg="Unable to mount %s as it does not exist" % args['src']) - if not os.path.exists(name) and not module.check_mode: try: os.makedirs(name)