From 8e34860d6ccda0cd9ebb5a86e2ba365e4b94767d Mon Sep 17 00:00:00 2001 From: Vladimir Botka Date: Thu, 21 Nov 2024 20:54:27 +0100 Subject: [PATCH 1/3] Fix #595. Remove comment from fstab entry on updating. --- plugins/modules/mount.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/modules/mount.py b/plugins/modules/mount.py index dadbd46..b9e496e 100644 --- a/plugins/modules/mount.py +++ b/plugins/modules/mount.py @@ -303,7 +303,7 @@ def _set_mount_save_old(module, args): continue - fields = line.split() + fields = line.split('#')[0].split() # Check if we got a valid line for splitting # (on Linux the 5th and the 6th field is optional) From 7b8d627552291a228ef9d6b6d8da469556970475 Mon Sep 17 00:00:00 2001 From: Vladimir Botka Date: Thu, 28 Nov 2024 08:17:41 +0100 Subject: [PATCH 2/3] Changelog fragment added. --- changelogs/fragments/597_remove_fstab_comment_on_updating.yml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 changelogs/fragments/597_remove_fstab_comment_on_updating.yml diff --git a/changelogs/fragments/597_remove_fstab_comment_on_updating.yml b/changelogs/fragments/597_remove_fstab_comment_on_updating.yml new file mode 100644 index 0000000..30d98d7 --- /dev/null +++ b/changelogs/fragments/597_remove_fstab_comment_on_updating.yml @@ -0,0 +1,3 @@ +--- +bugfixes: + - fstab - If a comment is appended to a fstab entry, state present creates a double-entry (https://github.com/ansible-collections/ansible.posix/issues/595). From 91129ed38107e807bb7c269a158b77c3f1d231e4 Mon Sep 17 00:00:00 2001 From: Vladimir Botka Date: Fri, 29 Nov 2024 03:34:14 +0100 Subject: [PATCH 3/3] Fix changelog fragment module name. --- changelogs/fragments/597_remove_fstab_comment_on_updating.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelogs/fragments/597_remove_fstab_comment_on_updating.yml b/changelogs/fragments/597_remove_fstab_comment_on_updating.yml index 30d98d7..c1c51a9 100644 --- a/changelogs/fragments/597_remove_fstab_comment_on_updating.yml +++ b/changelogs/fragments/597_remove_fstab_comment_on_updating.yml @@ -1,3 +1,3 @@ --- bugfixes: - - fstab - If a comment is appended to a fstab entry, state present creates a double-entry (https://github.com/ansible-collections/ansible.posix/issues/595). + - mount - If a comment is appended to a fstab entry, state present creates a double-entry (https://github.com/ansible-collections/ansible.posix/issues/595).