1
0
Fork 0
mirror of https://github.com/ansible-collections/ansible.posix.git synced 2026-02-04 08:01:49 +00:00

Merge pull request #563 from dtvillafana/main

(feat) add no_log option for 'opts' parameter

SUMMARY

Allows you to set no_log on just the opts parameter.
This is useful for CIFS/SMB mounts that would otherwise leak secrets.

Adds feature from issue: . #497
ISSUE TYPE


Feature Pull Request

COMPONENT NAME

mount

Reviewed-by: Hideki Saito <saito@fgrep.org>
This commit is contained in:
softwarefactory-project-zuul[bot] 2024-09-11 02:27:00 +00:00 committed by GitHub
commit d968ac441e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 64 additions and 0 deletions

View file

@ -43,6 +43,12 @@ options:
description:
- Mount options (see fstab(5), or vfstab(4) on Solaris).
type: str
opts_no_log:
description:
- Do not log opts.
type: bool
default: false
version_added: 1.6.0
dump:
description:
- Dump (see fstab(5)).
@ -209,6 +215,7 @@ EXAMPLES = r'''
src: //192.168.1.200/share
path: /mnt/smb_share
opts: "rw,vers=3,file_mode=0600,dir_mode=0700,dom={{ ad_domain }},username={{ ad_username }},password={{ ad_password }}"
opts_no_log: true
fstype: cifs
state: ephemeral
'''
@ -768,6 +775,7 @@ def main():
fstype=dict(type='str'),
path=dict(type='path', required=True, aliases=['name']),
opts=dict(type='str'),
opts_no_log=dict(type='bool', default=False),
passno=dict(type='str', no_log=False, default='0'),
src=dict(type='path'),
backup=dict(type='bool', default=False),
@ -781,6 +789,9 @@ def main():
),
)
if module.params['opts_no_log']:
module.no_log_values.add(module.params['opts'])
# solaris args:
# name, src, fstype, opts, boot, passno, state, fstab=/etc/vfstab
# linux args: