summaryrefslogtreecommitdiffstats
path: root/ci/ansible/roles/osdsdock/scenarios/lvm.yml
blob: d1d7b36271a7583a049546990865e9b697f215c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
---
- name: install lvm2 external package when lvm backend enabled
  apt:
    name: lvm2

- name: check if physical volume existed
  shell: pvdisplay {{ pv_device }}
  ignore_errors: yes
  register: pv_existed

- name: create a physical volume
  shell: pvcreate {{ pv_device }}
  when: pv_existed is undefined or pv_existed.rc != 0

- name: check if volume group existed
  shell: vgdisplay {{ vg_name }}
  ignore_errors: yes
  register: vg_existed

- name: create a volume group
  shell: vgcreate {{ vg_name }} {{ pv_device }}
  when: vg_existed is undefined or vg_existed.rc != 0