modules/mount.py

This commit is contained in:
Yves MOYROUD 2024-10-11 16:46:26 +02:00 committed by GitHub
parent 5bc6f636f7
commit 841a0f3314
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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"