mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 03:11:24 -07:00
* parted: proper fix for change of partition label case
calling mkpart even when partition existed before mklabel call, fixes #522
* changelog fragment for parted fix #522
* Update changelogs/fragments/522-parted_change_label.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* typo in comment
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 4931fb2681
)
Co-authored-by: Robert Osowiecki <robert.osowiecki@gmail.com>
This commit is contained in:
parent
0d459e5662
commit
d7c4849473
3 changed files with 18 additions and 2 deletions
|
@ -634,11 +634,12 @@ def main():
|
|||
if state == 'present':
|
||||
|
||||
# Assign label if required
|
||||
if current_device['generic'].get('table', None) != label:
|
||||
mklabel_needed = current_device['generic'].get('table', None) != label
|
||||
if mklabel_needed:
|
||||
script += "mklabel %s " % label
|
||||
|
||||
# Create partition if required
|
||||
if part_type and not part_exists(current_parts, 'num', number):
|
||||
if part_type and (mklabel_needed or not part_exists(current_parts, 'num', number)):
|
||||
script += "mkpart %s %s%s %s " % (
|
||||
part_type,
|
||||
'%s ' % fs_type if fs_type is not None else '',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue