From 211e6c74b514bad35ad19dd140044a0a1d043093 Mon Sep 17 00:00:00 2001 From: NdFeB Date: Sat, 12 Mar 2022 15:25:38 +0100 Subject: [PATCH 1/2] Fix absent state documentation --- plugins/modules/mount.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/plugins/modules/mount.py b/plugins/modules/mount.py index 8b28f12..4158c6b 100644 --- a/plugins/modules/mount.py +++ b/plugins/modules/mount.py @@ -32,6 +32,7 @@ options: description: - Device (or NFS volume, or something else) to be mounted on I(path). - Required when I(state) set to C(present) or C(mounted). + - Ignored when I(state) set to C(absent) or C(unmounted). type: path fstype: description: @@ -68,9 +69,13 @@ options: - If C(unmounted), the device will be unmounted without changing I(fstab). - C(present) only specifies that the device is to be configured in I(fstab) and does not trigger or require a mount. - - C(absent) specifies that the device mount's entry will be removed from - I(fstab) and will also unmount the device and remove the mount - point. + - C(absent) specifies that the mount point entry I(path) will be removed + from I(fstab) and will also unmount the mounted device and remove the + mount point. A mounted device will be unmounted regardless of I(src) or its + real source. C(absent) does not unmount recursively, and the module will + fail if multiple devices are mounted on the same mount point. Using + C(absent) with a mount point that is not registered in the I(fstab) has + no effect. Use C(unmounted) instead. - C(remounted) specifies that the device will be remounted for when you want to force a refresh on the mount itself (added in 2.9). This will always return changed=true. If I(opts) is set, the options will be From fa4dd35d664867944c01b00bab330b60f2cfde91 Mon Sep 17 00:00:00 2001 From: NdFeB Date: Sat, 12 Mar 2022 15:36:17 +0100 Subject: [PATCH 2/2] Add changelog fragment for PR 333 --- changelogs/fragments/333_doc_absent_precision.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 changelogs/fragments/333_doc_absent_precision.yml diff --git a/changelogs/fragments/333_doc_absent_precision.yml b/changelogs/fragments/333_doc_absent_precision.yml new file mode 100644 index 0000000..42ee162 --- /dev/null +++ b/changelogs/fragments/333_doc_absent_precision.yml @@ -0,0 +1,4 @@ +--- +trivial: +- mount - fix description in the documentation of the state ``absent`` to match its actual behavior + and point out that ``src`` is ignored with state ``absent`` and ``unmounted`` (https://github.com/ansible-collections/ansible.posix/issues/322)