c12s-kubespray/roles/kubernetes/preinstall/tasks/growpart-centos-7.yml

23 lines
561 B
YAML
Raw Normal View History

---
- name: install growpart
package: name=cloud-utils-growpart state=latest
- name: check if growpart needs to be run
command: growpart -N /dev/sda 1
failed_when: False
changed_when: "'NOCHANGE:' not in growpart_needed.stdout"
register: growpart_needed
- name: check fs type
command: file -Ls /dev/sda1
changed_when: False
register: fs_type
- name: run growpart
command: growpart /dev/sda 1
when: growpart_needed.changed
- name: run xfs_growfs
command: xfs_growfs /dev/sda1
when: growpart_needed.changed and 'XFS' in fs_type.stdout