mirror of
https://github.com/ansible-collections/ansible.posix.git
synced 2026-03-09 19:15:19 +01:00
Compare commits
11 commits
8b1e25ee54
...
3cc70c4bb3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3cc70c4bb3 | ||
|
|
795d8e34e7 | ||
|
|
b615d61fae | ||
|
|
bda85b7453 | ||
|
|
ac82f575c6 | ||
|
|
a356bdd3c4 | ||
|
|
4f93234a8b | ||
|
|
f392e407f9 | ||
|
|
c77c592fc6 | ||
|
|
02006a1e7f | ||
|
|
1512495dd7 |
6 changed files with 32 additions and 15 deletions
|
|
@ -178,8 +178,8 @@ stages:
|
||||||
targets:
|
targets:
|
||||||
- name: RHEL 9.3
|
- name: RHEL 9.3
|
||||||
test: rhel/9.3
|
test: rhel/9.3
|
||||||
- name: FreeBSD 13.2
|
- name: FreeBSD 13.3
|
||||||
test: freebsd/13.2
|
test: freebsd/13.3
|
||||||
- stage: Remote_2_16
|
- stage: Remote_2_16
|
||||||
displayName: Remote 2.16
|
displayName: Remote 2.16
|
||||||
dependsOn: []
|
dependsOn: []
|
||||||
|
|
|
||||||
3
changelogs/fragments/346-boot-linux.yml
Normal file
3
changelogs/fragments/346-boot-linux.yml
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
---
|
||||||
|
bugfix:
|
||||||
|
- mount - Handle ``boot`` option on Linux, NetBSD and OpenBSD correctly (https://github.com/ansible-collections/ansible.posix/issues/364).
|
||||||
|
|
@ -840,9 +840,6 @@ def main():
|
||||||
args['warnings'].append("Ignore the 'boot' due to 'opts' contains 'noauto'.")
|
args['warnings'].append("Ignore the 'boot' due to 'opts' contains 'noauto'.")
|
||||||
elif not module.params['boot']:
|
elif not module.params['boot']:
|
||||||
args['boot'] = 'no'
|
args['boot'] = 'no'
|
||||||
if 'defaults' in opts:
|
|
||||||
args['warnings'].append("Ignore the 'boot' due to 'opts' contains 'defaults'.")
|
|
||||||
else:
|
|
||||||
opts.append('noauto')
|
opts.append('noauto')
|
||||||
args['opts'] = ','.join(opts)
|
args['opts'] = ','.join(opts)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -472,6 +472,25 @@
|
||||||
path: /tmp/myfs
|
path: /tmp/myfs
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
|
- name: Mount the FS with noauto option and defaults
|
||||||
|
ansible.posix.mount:
|
||||||
|
path: /tmp/myfs
|
||||||
|
src: /tmp/myfs.img
|
||||||
|
fstype: ext3
|
||||||
|
state: mounted
|
||||||
|
boot: no
|
||||||
|
register: mount_info
|
||||||
|
|
||||||
|
- name: Assert the mount without noauto was successful
|
||||||
|
ansible.builtin.assert:
|
||||||
|
that:
|
||||||
|
- "'noauto' in mount_info['opts'].split(',')"
|
||||||
|
|
||||||
|
- name: Unmount FS
|
||||||
|
ansible.posix.mount:
|
||||||
|
path: /tmp/myfs
|
||||||
|
state: absent
|
||||||
|
|
||||||
- name: Remove the test FS
|
- name: Remove the test FS
|
||||||
ansible.builtin.file:
|
ansible.builtin.file:
|
||||||
path: '{{ item }}'
|
path: '{{ item }}'
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
- name: Attempt to add mapping without 'seuser'
|
- name: Attempt to add mapping without 'seuser'
|
||||||
register: selogin_error
|
register: selogin_error
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
community.general.system.selogin:
|
community.general.selogin:
|
||||||
login: seuser
|
login: seuser
|
||||||
- name: Verify failure
|
- name: Verify failure
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
- false
|
- false
|
||||||
- true
|
- true
|
||||||
- false
|
- false
|
||||||
community.general.system.selogin:
|
community.general.selogin:
|
||||||
login: seuser
|
login: seuser
|
||||||
seuser: staff_u
|
seuser: staff_u
|
||||||
- name: New mapping- verify functionality and check_mode
|
- name: New mapping- verify functionality and check_mode
|
||||||
|
|
@ -37,7 +37,7 @@
|
||||||
- false
|
- false
|
||||||
- true
|
- true
|
||||||
- false
|
- false
|
||||||
community.general.system.selogin:
|
community.general.selogin:
|
||||||
login: seuser
|
login: seuser
|
||||||
seuser: user_u
|
seuser: user_u
|
||||||
- name: Changed mapping- verify functionality and check_mode
|
- name: Changed mapping- verify functionality and check_mode
|
||||||
|
|
@ -55,7 +55,7 @@
|
||||||
- false
|
- false
|
||||||
- true
|
- true
|
||||||
- false
|
- false
|
||||||
community.general.system.selogin:
|
community.general.selogin:
|
||||||
login: seuser
|
login: seuser
|
||||||
state: absent
|
state: absent
|
||||||
- name: Delete mapping- verify functionality and check_mode
|
- name: Delete mapping- verify functionality and check_mode
|
||||||
|
|
|
||||||
|
|
@ -64,8 +64,7 @@ if sys.version_info >= (3,) and sys.version_info < (3, 4, 4):
|
||||||
# newline that our naive format() added
|
# newline that our naive format() added
|
||||||
data_as_list[-1] = data_as_list[-1][:-1]
|
data_as_list[-1] = data_as_list[-1][:-1]
|
||||||
|
|
||||||
for line in data_as_list:
|
yield from data_as_list
|
||||||
yield line
|
|
||||||
|
|
||||||
def mock_open(mock=None, read_data=''):
|
def mock_open(mock=None, read_data=''):
|
||||||
"""
|
"""
|
||||||
|
|
@ -93,8 +92,7 @@ if sys.version_info >= (3,) and sys.version_info < (3, 4, 4):
|
||||||
if handle.readline.return_value is not None:
|
if handle.readline.return_value is not None:
|
||||||
while True:
|
while True:
|
||||||
yield handle.readline.return_value
|
yield handle.readline.return_value
|
||||||
for line in _data:
|
yield from _data
|
||||||
yield line
|
|
||||||
|
|
||||||
global file_spec
|
global file_spec
|
||||||
if file_spec is None:
|
if file_spec is None:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue