From 38bfad46e8bcb7ff13ebeb1596b3ba3b685b0b4c Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Fri, 21 May 2021 13:25:25 +0200 Subject: [PATCH] container: conditionnally disable lvmetad Enabling lvmetad in containerized deployments on el7 based OS might cause issues. This commit make it possible to disable this service if needed. Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1955040 Signed-off-by: Guillaume Abrioux --- group_vars/all.yml.sample | 1 + group_vars/rhcs.yml.sample | 1 + .../tasks/prerequisites.yml | 18 ++++++++++++++++++ roles/ceph-defaults/defaults/main.yml | 1 + 4 files changed, 21 insertions(+) diff --git a/group_vars/all.yml.sample b/group_vars/all.yml.sample index 83dc3b1c7..57d7ef1e0 100644 --- a/group_vars/all.yml.sample +++ b/group_vars/all.yml.sample @@ -343,6 +343,7 @@ dummy: ## OSD options # +#lvmetad_disabled: false #is_hci: false #hci_safety_factor: 0.2 #non_hci_safety_factor: 0.7 diff --git a/group_vars/rhcs.yml.sample b/group_vars/rhcs.yml.sample index cc1f650c6..8559c3ca7 100644 --- a/group_vars/rhcs.yml.sample +++ b/group_vars/rhcs.yml.sample @@ -343,6 +343,7 @@ ceph_iscsi_config_dev: false ## OSD options # +#lvmetad_disabled: false #is_hci: false #hci_safety_factor: 0.2 #non_hci_safety_factor: 0.7 diff --git a/roles/ceph-container-common/tasks/prerequisites.yml b/roles/ceph-container-common/tasks/prerequisites.yml index c7761c311..cd4e801b6 100644 --- a/roles/ceph-container-common/tasks/prerequisites.yml +++ b/roles/ceph-container-common/tasks/prerequisites.yml @@ -1,4 +1,22 @@ --- +- name: lvmetad tasks related + when: + - inventory_hostname in groups.get(osd_group_name, []) + - lvmetad_disabled | default(False) | bool + - ansible_facts['os_family'] == 'RedHat' + - ansible_facts['distribution_major_version'] | int == 7 + block: + - name: stop lvmetad + service: + name: lvm2-lvmetad + state: stopped + + - name: disable and mask lvmetad service + service: + name: lvm2-lvmetad + enabled: no + masked: yes + - name: remove ceph udev rules file: path: "{{ item }}" diff --git a/roles/ceph-defaults/defaults/main.yml b/roles/ceph-defaults/defaults/main.yml index ff1763494..a22687d34 100644 --- a/roles/ceph-defaults/defaults/main.yml +++ b/roles/ceph-defaults/defaults/main.yml @@ -335,6 +335,7 @@ cephfs_pools: ## OSD options # +lvmetad_disabled: false is_hci: false hci_safety_factor: 0.2 non_hci_safety_factor: 0.7 -- 2.39.5