summaryrefslogtreecommitdiffstats
path: root/roles/openshift_expand_partition/tasks/main.yml
blob: b74d635d5c16c406d386f596de9e6f7a8651d23f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
---
- name: Ensure growpart is installed
  action: "{{ ansible_pkg_mgr }} name=cloud-utils-growpart state=present" and not is_atomic

- name: Determine if growpart is installed
  command: "rpm -q cloud-utils-growpart"
  register: has_growpart
  failed_when: "has_growpart.cr != 0 and 'package cloud-utils-growpart is not installed' not in has_growpart.stdout"
  changed_when: false
  when: is_atomic

- name: Grow the partitions
  command: "growpart {{oep_drive}} {{oep_partition}}"

- name: Expand the filesystem - xfs
  command: "xfs_growfs {{oep_drive}}{{oep_partition}}"
  when: oep_file_system == "xfs"

- name: Expand the filesystem - ext(2,3,4)
  command: "resize2fs {{oep_drive}}{{oep_partition}}"
  when: oep_file_system == "ext"