mirror of
https://github.com/ansible-collections/ansible.posix.git
synced 2026-01-11 23:25:28 +01:00
modules/mount.py
This commit is contained in:
parent
5bc6f636f7
commit
841a0f3314
1 changed files with 17 additions and 0 deletions
|
|
@ -186,6 +186,23 @@ EXAMPLES = r'''
|
||||||
path: /tmp/mnt-pnt
|
path: /tmp/mnt-pnt
|
||||||
state: remounted
|
state: remounted
|
||||||
|
|
||||||
|
# The following will fail on first run
|
||||||
|
# if /home/mydir is not empty after unmounting,
|
||||||
|
# though unmount and remove from fstab are successfull.
|
||||||
|
# It will be successfull on subsequent runs (already unmounted).
|
||||||
|
- name: Unmount and remove from fstab, then if unmount was necessary try to remove mountpoint /home/mydir
|
||||||
|
ansible.posix.mount:
|
||||||
|
path: /home/mydir
|
||||||
|
state: absent
|
||||||
|
# The following will not fail on first run
|
||||||
|
# if /home/mydir is not empty after unmounting.
|
||||||
|
# It will leave /home/mydir and its content (if any) after unmounting.
|
||||||
|
- name: Unmount and remove from fstab, but keep /home/mydir
|
||||||
|
ansible.posix.mount:
|
||||||
|
path: /home/mydir
|
||||||
|
state: absent
|
||||||
|
keep_mountpoint: true
|
||||||
|
|
||||||
# The following will not save changes to fstab, and only be temporary until
|
# The following will not save changes to fstab, and only be temporary until
|
||||||
# a reboot, or until calling "state: unmounted" followed by "state: mounted"
|
# a reboot, or until calling "state: unmounted" followed by "state: mounted"
|
||||||
# on the same "path"
|
# on the same "path"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue