mirror of
https://github.com/ansible-collections/ansible.posix.git
synced 2026-01-12 07:35:31 +01:00
Merge branch 'ansible-collections:main' into module-at-add-chdir
This commit is contained in:
commit
3206c5c1b7
2 changed files with 12 additions and 5 deletions
4
changelogs/fragments/203_boot_opt_for_bsd.yml
Normal file
4
changelogs/fragments/203_boot_opt_for_bsd.yml
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
---
|
||||||
|
minor_changes:
|
||||||
|
- mount - Change behavior of ``boot`` option to set ``noauto`` on BSD nodes
|
||||||
|
(https://github.com/ansible-collections/ansible.posix/issues/28).
|
||||||
|
|
@ -96,7 +96,10 @@ options:
|
||||||
- Only applies to Solaris and Linux systems.
|
- Only applies to Solaris and Linux systems.
|
||||||
- For Solaris systems, C(true) will set C(yes) as the value of mount at boot
|
- For Solaris systems, C(true) will set C(yes) as the value of mount at boot
|
||||||
in I(/etc/vfstab).
|
in I(/etc/vfstab).
|
||||||
- For Linux systems, C(true) will add C(noauto) to mount options in I(/etc/fstab).
|
- For Linux, FreeBSD, NetBSD and OpenBSD systems, C(false) will add C(noauto)
|
||||||
|
to mount options in I(/etc/fstab).
|
||||||
|
- To avoid mount option conflicts, if C(noauto) specified in C(opts),
|
||||||
|
mount module will ignore C(boot).
|
||||||
type: bool
|
type: bool
|
||||||
default: yes
|
default: yes
|
||||||
backup:
|
backup:
|
||||||
|
|
@ -722,10 +725,10 @@ def main():
|
||||||
for key in ('src', 'fstype', 'passno', 'opts', 'dump', 'fstab'):
|
for key in ('src', 'fstype', 'passno', 'opts', 'dump', 'fstab'):
|
||||||
if module.params[key] is not None:
|
if module.params[key] is not None:
|
||||||
args[key] = module.params[key]
|
args[key] = module.params[key]
|
||||||
if platform.system().lower() == 'linux':
|
if platform.system().lower() == 'linux' or platform.system().lower().endswith('bsd'):
|
||||||
# Linux has 'noauto' as mount opts to handle mount on boot
|
# Linux, FreeBSD, NetBSD and OpenBSD have 'noauto' as mount option to
|
||||||
# So boot option should manage 'noauto' in opts
|
# handle mount on boot. To avoid mount option conflicts, if 'noauto'
|
||||||
# TODO: We need to support other system like *BSD that 'noauto' option available
|
# specified in 'opts', mount module will ignore 'boot'.
|
||||||
opts = args['opts'].split(',')
|
opts = args['opts'].split(',')
|
||||||
if 'noauto' in opts:
|
if 'noauto' in opts:
|
||||||
args['warnings'].append("Ignore the 'boot' due to 'opts' contains 'noauto'.")
|
args['warnings'].append("Ignore the 'boot' due to 'opts' contains 'noauto'.")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue