mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
This commit is contained in:
parent
fd839d7a67
commit
c93f24b45b
3 changed files with 118 additions and 2 deletions
|
@ -218,7 +218,13 @@ def set_mount(module, args):
|
|||
) = line.split()
|
||||
|
||||
# Check if we found the correct line
|
||||
if ld['name'] != escaped_args['name']:
|
||||
if (
|
||||
ld['name'] != escaped_args['name'] or (
|
||||
# In the case of swap, check the src instead
|
||||
'src' in args and
|
||||
ld['name'] == 'none' and
|
||||
ld['fstype'] == 'swap' and
|
||||
ld['src'] != args['src'])):
|
||||
to_write.append(line)
|
||||
|
||||
continue
|
||||
|
@ -299,7 +305,13 @@ def unset_mount(module, args):
|
|||
ld['passno']
|
||||
) = line.split()
|
||||
|
||||
if ld['name'] != escaped_name:
|
||||
if (
|
||||
ld['name'] != escaped_name or (
|
||||
# In the case of swap, check the src instead
|
||||
'src' in args and
|
||||
ld['name'] == 'none' and
|
||||
ld['fstype'] == 'swap' and
|
||||
ld['src'] != args['src'])):
|
||||
to_write.append(line)
|
||||
|
||||
continue
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue