From a6df9350bc36d2f6eb262af58084f16424136585 Mon Sep 17 00:00:00 2001 From: David Galloway Date: Fri, 29 Sep 2017 14:59:40 -0400 Subject: [PATCH] testnode: Mount /var/lib/ceph to NVMe partition on smithi Fixes: http://tracker.ceph.com/issues/20910 Signed-off-by: David Galloway --- roles/testnode/tasks/main.yml | 15 +++++++++++---- roles/testnode/tasks/var_lib.yml | 21 +++++++++++++++++++++ roles/testnode/tasks/zap_disks.yml | 7 +++++++ 3 files changed, 39 insertions(+), 4 deletions(-) create mode 100644 roles/testnode/tasks/var_lib.yml diff --git a/roles/testnode/tasks/main.yml b/roles/testnode/tasks/main.yml index 50ba841c..5f511566 100644 --- a/roles/testnode/tasks/main.yml +++ b/roles/testnode/tasks/main.yml @@ -34,6 +34,17 @@ tags: - partition +- name: set up LVM + include: lvm.yml + tags: + - lvm + +- name: mount /var/lib/ceph to specified partition + include: var_lib.yml + when: var_lib_partition is defined + tags: + - varlib + - name: configure ssh include: ssh.yml tags: @@ -82,10 +93,6 @@ tags: - cpan -- include: lvm.yml - tags: - - lvm - # configure ntp - include: ntp.yml tags: diff --git a/roles/testnode/tasks/var_lib.yml b/roles/testnode/tasks/var_lib.yml new file mode 100644 index 00000000..be95e4aa --- /dev/null +++ b/roles/testnode/tasks/var_lib.yml @@ -0,0 +1,21 @@ +--- +# This set of tasks is intended to mount a small NVMe partition to /var/lib/ceph +# to fix http://tracker.ceph.com/issues/20910 + +- name: "Create /var/lib/ceph" + file: + path: "/var/lib/ceph" + state: directory + +- name: "Create xfs filesystem on {{ var_lib_partition }}" + filesystem: + dev: "{{ var_lib_partition }}" + fstype: xfs + force: yes + +- name: "Mount {{ var_lib_partition }} to /var/lib/ceph" + mount: + path: "/var/lib/ceph" + src: "{{ var_lib_partition }}" + fstype: xfs + state: mounted diff --git a/roles/testnode/tasks/zap_disks.yml b/roles/testnode/tasks/zap_disks.yml index e893f5ed..ad6ef743 100644 --- a/roles/testnode/tasks/zap_disks.yml +++ b/roles/testnode/tasks/zap_disks.yml @@ -32,6 +32,13 @@ shell: "lsblk --list --noheadings | grep part | grep -v {{ root_disk|regex_replace('/dev/', '') }} | awk '{ print $1 }'" register: non_root_partitions +- name: Unmount any non-root mountpoints + mount: + path: "{{ item.mount }}" + state: unmounted + with_items: "{{ ansible_mounts }}" + when: item.mount != '/' + ## http://tracker.ceph.com/issues/20533 ## Trusty version of wipefs lacks --force option - name: Wipe filesystems on non-root partitions -- 2.47.3