From 219fa8f9191f412edbfd068840289753ba4a2c87 Mon Sep 17 00:00:00 2001 From: Ali Maredia Date: Mon, 29 Oct 2018 06:01:25 +0000 Subject: [PATCH] infrastructure playbooks: ensure nvme_device is defined in lv-create.yml Signed-off-by: Ali Maredia --- infrastructure-playbooks/lv-create.yml | 6 ++++++ .../vars/{lv_vars.yaml => lv_vars.yaml.sample} | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) rename infrastructure-playbooks/vars/{lv_vars.yaml => lv_vars.yaml.sample} (99%) diff --git a/infrastructure-playbooks/lv-create.yml b/infrastructure-playbooks/lv-create.yml index b1c87d525..2bd75984d 100644 --- a/infrastructure-playbooks/lv-create.yml +++ b/infrastructure-playbooks/lv-create.yml @@ -27,6 +27,12 @@ file: lv_vars.yaml failed_when: false + # ensure nvme_device is set + - name: fail if nvme_device is not undefined + fail: + msg: "nvme_device has not been set by the user" + when: nvme_device is undefined or nvme_device == 'dummy' + # need to check if lvm2 is installed - name: install lvm2 package: diff --git a/infrastructure-playbooks/vars/lv_vars.yaml b/infrastructure-playbooks/vars/lv_vars.yaml.sample similarity index 99% rename from infrastructure-playbooks/vars/lv_vars.yaml rename to infrastructure-playbooks/vars/lv_vars.yaml.sample index 314e0eafa..ba618a10a 100644 --- a/infrastructure-playbooks/vars/lv_vars.yaml +++ b/infrastructure-playbooks/vars/lv_vars.yaml.sample @@ -12,7 +12,7 @@ # This can be done by running `wipefs -a $device_name`. # Path of nvme device primed for LV creation for journals and data. Only one NVMe device is allowed at a time. Providing a list will not work in this case. -nvme_device: /dev/nvme0n1 +nvme_device: dummy # Path of hdd devices designated for LV creation. hdd_devices: