This commit is contained in:
copyrights 2023-08-04 23:22:56 +01:00 committed by GitHub
commit 15f15c3ee1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 5 deletions

View file

@ -0,0 +1,3 @@
---
bugfix:
- mount - Handle ``boot`` option on Linux, NetBSD and OpenBSD correctly (https://github.com/ansible-collections/ansible.posix/issues/364).

View file

@ -835,9 +835,6 @@ def main():
args['warnings'].append("Ignore the 'boot' due to 'opts' contains 'noauto'.") args['warnings'].append("Ignore the 'boot' due to 'opts' contains 'noauto'.")
elif not module.params['boot']: elif not module.params['boot']:
args['boot'] = 'no' args['boot'] = 'no'
if 'defaults' in opts:
args['warnings'].append("Ignore the 'boot' due to 'opts' contains 'defaults'.")
else:
opts.append('noauto') opts.append('noauto')
args['opts'] = ','.join(opts) args['opts'] = ','.join(opts)

View file

@ -367,6 +367,25 @@
path: /tmp/myfs path: /tmp/myfs
state: absent 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 - name: Remove the test FS
file: file:
path: '{{ item }}' path: '{{ item }}'