summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSerge van Ginderachter <serge@vanginderachter.be>2014-07-17 14:49:40 +0200
committerJames Cammarata <jimi@sngx.net>2014-08-14 15:00:45 -0500
commit1dd484cc2df0257a1b24bb22aada001201e3fb3e (patch)
tree9525cbcc5299bc2de2a6815566f1cb21c233fc87
parent31210084756c59fb2bb8dc3e7c259b895b8f128b (diff)
downloadansible-1dd484cc2df0257a1b24bb22aada001201e3fb3e.tar.gz
execute the mount after path validation
This avoids a stale situation where name/path contains some impossible path, but gets configured (faultly) in fstab, and the module only fails after that, when creating that path.
-rwxr-xr-xlibrary/system/mount3
1 files changed, 2 insertions, 1 deletions
diff --git a/library/system/mount b/library/system/mount
index a886a04dbd..9dc6fbe7b8 100755
--- a/library/system/mount
+++ b/library/system/mount
@@ -307,7 +307,6 @@ def main():
module.exit_json(changed=changed, **args)
if state in ['mounted', 'present']:
- name, changed = set_mount(**args)
if state == 'mounted':
if not os.path.exists(name):
try:
@@ -315,6 +314,8 @@ def main():
except (OSError, IOError), e:
module.fail_json(msg="Error making dir %s: %s" % (name, str(e)))
+ name, changed = set_mount(**args)
+ if state == 'mounted':
res = 0
if os.path.ismount(name):
if changed: