From 1512495dd774e9b566db4d007e73d65bbef66639 Mon Sep 17 00:00:00 2001 From: copyrights Date: Mon, 23 May 2022 22:21:11 +0200 Subject: [PATCH 1/3] mount: remove boot exception if defaults in opts --- plugins/modules/mount.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/plugins/modules/mount.py b/plugins/modules/mount.py index 2021464..65d6efd 100644 --- a/plugins/modules/mount.py +++ b/plugins/modules/mount.py @@ -743,11 +743,8 @@ def main(): args['warnings'].append("Ignore the 'boot' due to 'opts' contains 'noauto'.") elif not module.params['boot']: args['boot'] = 'no' - if 'defaults' in opts: - args['warnings'].append("Ignore the 'boot' due to 'opts' contains 'defaults'.") - else: - opts.append('noauto') - args['opts'] = ','.join(opts) + opts.append('noauto') + args['opts'] = ','.join(opts) # If fstab file does not exist, we first need to create it. This mainly # happens when fstab option is passed to the module. From 02006a1e7f580d6ac4739f980e300950f03ebbb9 Mon Sep 17 00:00:00 2001 From: copyrights Date: Mon, 23 May 2022 22:52:38 +0200 Subject: [PATCH 2/3] add mount boot test --- .../integration/targets/mount/tasks/main.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/integration/targets/mount/tasks/main.yml b/tests/integration/targets/mount/tasks/main.yml index be1850f..c606160 100644 --- a/tests/integration/targets/mount/tasks/main.yml +++ b/tests/integration/targets/mount/tasks/main.yml @@ -361,6 +361,25 @@ path: /tmp/myfs state: absent + - name: Mount the FS with noauto option and defaults + mount: + path: /tmp/myfs + src: /tmp/myfs.img + fstype: ext3 + state: mounted + boot: no + register: mount_info + + - name: assert the mount without noauto was successful + assert: + that: + - "'noauto' in mount_info['opts'].split(',')" + + - name: Unmount FS + mount: + path: /tmp/myfs + state: absent + - name: Remove the test FS file: path: '{{ item }}' From c77c592fc632ecc5ce55b2449bce2f73d96446ae Mon Sep 17 00:00:00 2001 From: copyrights Date: Tue, 24 May 2022 07:10:54 +0200 Subject: [PATCH 3/3] add changelog fragment --- changelogs/fragments/346-boot-linux.yml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 changelogs/fragments/346-boot-linux.yml diff --git a/changelogs/fragments/346-boot-linux.yml b/changelogs/fragments/346-boot-linux.yml new file mode 100644 index 0000000..c0a2ae5 --- /dev/null +++ b/changelogs/fragments/346-boot-linux.yml @@ -0,0 +1,3 @@ +--- +bugfix: + - mount - Handle ``boot`` option on Linux, NetBSD and OpenBSD correctly (https://github.com/ansible-collections/ansible.posix/issues/364).