Remove repartition tasks
This commit is contained in:
parent
a76c528b35
commit
9d97146c15
|
@ -1,40 +1,4 @@
|
|||
---
|
||||
- name: Make sure parted is installed
|
||||
apt:
|
||||
name: parted
|
||||
state: present
|
||||
update_cache: yes
|
||||
|
||||
- name: Turn off all swap areas
|
||||
command: swapoff -a
|
||||
become: yes
|
||||
|
||||
- name: Remove swap partition from /etc/fstab
|
||||
mount:
|
||||
path: none
|
||||
fstype: swap
|
||||
opts: sw
|
||||
state: absent
|
||||
|
||||
- name: Remove partition number 5
|
||||
parted:
|
||||
device: /dev/sda
|
||||
number: 5
|
||||
state: absent
|
||||
|
||||
- name: Remove partition number 2
|
||||
parted:
|
||||
device: /dev/sda
|
||||
number: 2
|
||||
state: absent
|
||||
register: rm_part_2_sda_info
|
||||
|
||||
- name: Resize partition 1 to reach end of disk if it does not already
|
||||
command: parted ---pretend-input-tty /dev/sda unit % resizepart 1 yes 100
|
||||
become: yes
|
||||
when: rm_part_2_sda_info['disk']['size'] != rm_part_2_sda_info['partitions'][0]['end']
|
||||
register: parted_resize
|
||||
|
||||
- name: Resize filesystem on /dev/sda1 to fill the available space on the partition
|
||||
filesystem:
|
||||
dev: /dev/sda1
|
||||
|
|
Loading…
Reference in New Issue