mirror of
https://github.com/ansible-collections/ansible.posix.git
synced 2026-02-03 23:51:48 +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:
commit
d968ac441e
3 changed files with 64 additions and 0 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue