2 Commits

Author SHA1 Message Date
David Villafaña
3eb792b650 Merge 6b7f98a212 into 0ed72d0004 2024-09-11 01:20:55 +00:00
dvillafana
6b7f98a212 (feat) add no_log options for 'opts' parameter
* Fixed #497
2024-09-11 10:20:00 +09:00
3 changed files with 52 additions and 1 deletions

View File

@@ -1,7 +1,7 @@
---
namespace: ansible
name: posix
version: 1.5.5
version: 1.5.4
readme: README.md
authors:
- Ansible (github.com/ansible)

View File

@@ -48,6 +48,7 @@ options:
- Do not log opts.
type: bool
default: false
version_added: 1.5.5
dump:
description:
- Dump (see fstab(5)).

View File

@@ -739,3 +739,53 @@
- /tmp/myfs_A.img
- /tmp/myfs_B.img
- /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: ext3
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: ext3
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: ext3
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