ops-docker-storage-reinitialize.yml: Pass wipefs a device path
With NVMe storage, the DEVS entry in /etc/sysconfig/docker-storage-setup
is now commonly a device name like "nvme1n1" instead of "/dev/nvme1n1".
But wipefs wants a device PATH, so augment the DEVS entry with a
path if necessary.
msg: "Failed to remove the docker VG. You may need to disable the docker and atomic-openshift-node services and reboot the machine. Then re-run this playbook. Once it has been re-initialized, re-enable the atomic-openshift-node service."
when: vgremove_output|failed
+ # Sometimes DEVS is an absolute path (e.g. /dev/xvdb),
+ # sometimes DEVS is just the device name (e.g. nvme1n1).
+ - name: Extract the device path
+ set_fact:
+ device_path: "{{ docker_storage_setup.DEVS | dirname | default('/dev', true) }}/{{ docker_storage_setup.DEVS | basename }}"
+
- name: Wipe the filesystem
- command: "wipefs --all '{{ docker_storage_setup.DEVS }}'"
+ command: "wipefs --all '{{ device_path }}'"
- name: Run docker-storage-setup to initialize docker storage
command: docker-storage-setup
