Skip to content

Commit 3a5972d

Browse files
authored
Merge pull request #219 from scality/preflight_check_storage
Detect old storage configuration earlier in the playbook
2 parents 3ce022a + 638a8e3 commit 3a5972d

File tree

2 files changed

+20
-14
lines changed

2 files changed

+20
-14
lines changed

roles/preflight_checks/action_plugins/validate_inventory.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,26 @@ def check_no_duplicate_addresses(task_vars):
6868
seen_addresses.add(address)
6969

7070

71+
def check_no_old_storage_configuration(task_vars):
72+
'''
73+
Check that the storage configuration of MetalK8s < 0.2.0 is not present
74+
anymore
75+
'''
76+
77+
for host in task_vars['hostvars'].keys():
78+
assert 'metal_k8s_lvm' not in task_vars['hostvars'][host], (
79+
"You are still having the old storage configuration for {host}. "
80+
"A breaking change was introduced in MetalK8s 0.2.0 "
81+
"and the default LVM Volume Group has been changed "
82+
"from 'kubevg' to '{metalk8s_lvm_default_vg}'. "
83+
"Please follow the 'Upgrading from MetalK8s < 0.2.0' "
84+
"chapter of the documentation").format(
85+
host=host,
86+
metalk8s_lvm_default_vg=task_vars['hostvars'][host].get(
87+
'metalk8s_lvm_default_vg', 'vg_metalk8s')
88+
)
89+
90+
7191
class ActionModule(ActionBase):
7292
def run(self, tmp=None, task_vars=None):
7393
if task_vars is None:

roles/setup_lvm_vg/tasks/main.yml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,3 @@
1-
# TODO: link to documentation in fail message
2-
- name: "LVM Setup: Detect old configuration style < 0.2.0"
3-
tags:
4-
- assertion
5-
fail:
6-
msg: >
7-
You're still having the old storage configuration.
8-
A breaking change was introduced in MetalK8s 0.2.0 and the default
9-
LVM Volume Group has been changed from "kubevg" to
10-
{{ metalk8s_lvm_default_vg }}.
11-
Please follow the "Upgrading from MetalK8s < 0.2.0" chapter of the
12-
documentation
13-
when: metal_k8s_lvm is defined
14-
151
- name: "LVM Setup: Check LVM packages"
162
package:
173
name: '{{ item }}'

0 commit comments

Comments
 (0)