mirror of
https://github.com/ansible-collections/ansible.posix.git
synced 2026-01-11 23:25:28 +01:00
Add mode option for mount module
This commit is contained in:
parent
6663bf535a
commit
d9f85d3ce8
1 changed files with 8 additions and 3 deletions
|
|
@ -827,13 +827,18 @@ def main():
|
|||
if not (ex.errno == errno.EEXIST and os.path.isdir(b_curpath)):
|
||||
raise
|
||||
|
||||
if mode is not None:
|
||||
os.chmod(name, int(mode))
|
||||
|
||||
except (OSError, IOError) as e:
|
||||
module.fail_json(
|
||||
msg="Error making dir %s: %s" % (name, to_native(e)))
|
||||
|
||||
# Set permissions to the newly created mount point.
|
||||
if mode is not None:
|
||||
try:
|
||||
changed = module.set_mode_if_different(name, mode, changed)
|
||||
except Exception as e:
|
||||
module.fail_json(
|
||||
msg="Error setting permissions %s: %s" % (name, to_native(e)))
|
||||
|
||||
name, backup_lines, changed = _set_mount_save_old(module, args)
|
||||
res = 0
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue