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

32 lines
757 B
YAML
Raw Permalink Normal View History

---
2016-12-12 13:14:22 +00:00
# Running growpart seems to be only required on Azure, as other Cloud Providers do this at boot time
- name: install growpart
package:
name: cloud-utils-growpart
state: present
- 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
2018-08-05 10:48:07 +00:00
environment:
2018-07-30 22:52:56 +00:00
LC_ALL: C
- name: check fs type
command: file -Ls /dev/sda1
changed_when: False
register: fs_type
- name: run growpart # noqa 503
command: growpart /dev/sda 1
when: growpart_needed.changed
2018-08-05 10:48:07 +00:00
environment:
2018-07-30 22:56:09 +00:00
LC_ALL: C
- name: run xfs_growfs # noqa 503
command: xfs_growfs /dev/sda1
2018-07-30 22:52:56 +00:00
when: growpart_needed.changed and 'XFS' in fs_type.stdout