ansible/resize.yml: playbook for /data resizing

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2022-10-05 20:48:51 +02:00
parent 78a2175c08
commit 67ff99c4d1
No known key found for this signature in database
GPG Key ID: 09AA5403E54D9931
1 changed files with 21 additions and 0 deletions

21
ansible/resize.yml Normal file
View File

@ -0,0 +1,21 @@
---
- name: Resize /data volume
hosts: all
serial: '{{ serial|default(1) }}'
tasks:
- systemd: name=docker state=stopped
- command: awk '/\/data/{print $1}' /etc/mtab
register: device_path
- name: umount /docker
command: umount /docker
- name: umount /data
command: umount /data
- name: e2fsck {{ device_path.stdout }}
command: e2fsck -pf {{ device_path.stdout }}
- name: resize2fs {{ device_path.stdout }}
command: resize2fs {{ device_path.stdout }}
- name: mount /data
command: mount /data
- name: mount /docker
command: mount /docker
- systemd: name=docker state=started