mirror of
https://github.com/ansible-collections/ansible.posix.git
synced 2026-01-13 08:05:19 +01:00
Compare commits
No commits in common. "d968ac441e4fbfb279468aab719e42e9f3b863fc" and "0ed72d0004fb454668737fe48939985788949c6e" have entirely different histories.
d968ac441e
...
0ed72d0004
3 changed files with 0 additions and 64 deletions
|
|
@ -1,3 +0,0 @@
|
||||||
---
|
|
||||||
minor_changes:
|
|
||||||
- mount - add no_log option for opts parameter (https://github.com/ansible-collections/ansible.posix/pull/563).
|
|
||||||
|
|
@ -43,12 +43,6 @@ options:
|
||||||
description:
|
description:
|
||||||
- Mount options (see fstab(5), or vfstab(4) on Solaris).
|
- Mount options (see fstab(5), or vfstab(4) on Solaris).
|
||||||
type: str
|
type: str
|
||||||
opts_no_log:
|
|
||||||
description:
|
|
||||||
- Do not log opts.
|
|
||||||
type: bool
|
|
||||||
default: false
|
|
||||||
version_added: 1.6.0
|
|
||||||
dump:
|
dump:
|
||||||
description:
|
description:
|
||||||
- Dump (see fstab(5)).
|
- Dump (see fstab(5)).
|
||||||
|
|
@ -215,7 +209,6 @@ EXAMPLES = r'''
|
||||||
src: //192.168.1.200/share
|
src: //192.168.1.200/share
|
||||||
path: /mnt/smb_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: "rw,vers=3,file_mode=0600,dir_mode=0700,dom={{ ad_domain }},username={{ ad_username }},password={{ ad_password }}"
|
||||||
opts_no_log: true
|
|
||||||
fstype: cifs
|
fstype: cifs
|
||||||
state: ephemeral
|
state: ephemeral
|
||||||
'''
|
'''
|
||||||
|
|
@ -775,7 +768,6 @@ def main():
|
||||||
fstype=dict(type='str'),
|
fstype=dict(type='str'),
|
||||||
path=dict(type='path', required=True, aliases=['name']),
|
path=dict(type='path', required=True, aliases=['name']),
|
||||||
opts=dict(type='str'),
|
opts=dict(type='str'),
|
||||||
opts_no_log=dict(type='bool', default=False),
|
|
||||||
passno=dict(type='str', no_log=False, default='0'),
|
passno=dict(type='str', no_log=False, default='0'),
|
||||||
src=dict(type='path'),
|
src=dict(type='path'),
|
||||||
backup=dict(type='bool', default=False),
|
backup=dict(type='bool', default=False),
|
||||||
|
|
@ -789,9 +781,6 @@ def main():
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
if module.params['opts_no_log']:
|
|
||||||
module.no_log_values.add(module.params['opts'])
|
|
||||||
|
|
||||||
# solaris args:
|
# solaris args:
|
||||||
# name, src, fstype, opts, boot, passno, state, fstab=/etc/vfstab
|
# name, src, fstype, opts, boot, passno, state, fstab=/etc/vfstab
|
||||||
# linux args:
|
# linux args:
|
||||||
|
|
|
||||||
|
|
@ -739,53 +739,3 @@
|
||||||
- /tmp/myfs_A.img
|
- /tmp/myfs_A.img
|
||||||
- /tmp/myfs_B.img
|
- /tmp/myfs_B.img
|
||||||
- /tmp/myfs
|
- /tmp/myfs
|
||||||
|
|
||||||
- name: Block to test opts_no_log option
|
|
||||||
when: ansible_system == 'Linux'
|
|
||||||
block:
|
|
||||||
- name: Create an empty file
|
|
||||||
community.general.filesize:
|
|
||||||
path: /tmp/myfs.img
|
|
||||||
size: 1M
|
|
||||||
- name: Format FS
|
|
||||||
community.general.filesystem:
|
|
||||||
fstype: ext4
|
|
||||||
dev: /tmp/myfs.img
|
|
||||||
- name: Mount the FS with opts_no_log option true
|
|
||||||
ansible.posix.mount:
|
|
||||||
path: /tmp/myfs
|
|
||||||
src: /tmp/myfs.img
|
|
||||||
fstype: ext4
|
|
||||||
state: mounted
|
|
||||||
opts: rw
|
|
||||||
opts_no_log: true
|
|
||||||
register: mount_info
|
|
||||||
- name: Assert opts_no_log option true
|
|
||||||
ansible.builtin.assert:
|
|
||||||
that:
|
|
||||||
- mount_info.opts == 'VALUE_SPECIFIED_IN_NO_LOG_PARAMETER'
|
|
||||||
- name: Remount the FS with opts_no_log option false
|
|
||||||
ansible.posix.mount:
|
|
||||||
path: /tmp/myfs
|
|
||||||
src: /tmp/myfs.img
|
|
||||||
fstype: ext4
|
|
||||||
state: remounted
|
|
||||||
opts: rw,user
|
|
||||||
opts_no_log: false
|
|
||||||
register: mount_info
|
|
||||||
- name: Assert opts_no_log option false
|
|
||||||
ansible.builtin.assert:
|
|
||||||
that:
|
|
||||||
- mount_info.opts == 'rw,user'
|
|
||||||
always:
|
|
||||||
- name: Unmount FS
|
|
||||||
ansible.posix.mount:
|
|
||||||
path: /tmp/myfs
|
|
||||||
state: absent
|
|
||||||
- name: Remove the test FS
|
|
||||||
ansible.builtin.file:
|
|
||||||
path: '{{ item }}'
|
|
||||||
state: absent
|
|
||||||
loop:
|
|
||||||
- /tmp/myfs.img
|
|
||||||
- /tmp/myfs
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue