mirror of
https://github.com/ansible-collections/ansible.posix.git
synced 2026-01-13 08:05:19 +01:00
Compare commits
4 commits
a48cc59977
...
7ed13ffbdf
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7ed13ffbdf | ||
|
|
9cf2d8cc48 | ||
|
|
2041e7f918 | ||
|
|
c8d3acb75f |
4 changed files with 26 additions and 7 deletions
3
changelogs/fragments/365-boot-linux.yml
Normal file
3
changelogs/fragments/365-boot-linux.yml
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
---
|
||||||
|
bugfixes:
|
||||||
|
- mount - Handle ``boot`` option on Linux, NetBSD and OpenBSD correctly (https://github.com/ansible-collections/ansible.posix/issues/364).
|
||||||
|
|
@ -850,11 +850,8 @@ 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:
|
opts.append('noauto')
|
||||||
args['warnings'].append("Ignore the 'boot' due to 'opts' contains 'defaults'.")
|
args['opts'] = ','.join(opts)
|
||||||
else:
|
|
||||||
opts.append('noauto')
|
|
||||||
args['opts'] = ','.join(opts)
|
|
||||||
|
|
||||||
# If fstab file does not exist, we first need to create it. This mainly
|
# If fstab file does not exist, we first need to create it. This mainly
|
||||||
# happens when fstab option is passed to the module.
|
# happens when fstab option is passed to the module.
|
||||||
|
|
|
||||||
|
|
@ -449,8 +449,8 @@ def main():
|
||||||
except ValueError:
|
except ValueError:
|
||||||
module.fail_json(msg='Could not determine controller hostname for rsync to send to')
|
module.fail_json(msg='Could not determine controller hostname for rsync to send to')
|
||||||
else:
|
else:
|
||||||
source = module.params['src']
|
source = '"' + module.params['src'] + '"'
|
||||||
dest = module.params['dest']
|
dest = '"' + module.params['dest'] + '"'
|
||||||
dest_port = module.params['dest_port']
|
dest_port = module.params['dest_port']
|
||||||
delete = module.params['delete']
|
delete = module.params['delete']
|
||||||
private_key = module.params['private_key']
|
private_key = module.params['private_key']
|
||||||
|
|
|
||||||
|
|
@ -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: false
|
||||||
|
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 }}'
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue