From 01256ffe1be8466abbe58e28e52ee7c73009fcba 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 c936eefa5..21120e3bc 100644 --- a/group_vars/all.yml.sample +++ b/group_vars/all.yml.sample @@ -342,6 +342,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 019d63bbd..74a4e0e38 100644 --- a/group_vars/rhcs.yml.sample +++ b/group_vars/rhcs.yml.sample @@ -342,6 +342,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..1baf96a05 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: lvmetad + state: stopped + + - name: disable and mask lvmetad service + service: + name: 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 08fb9813f..e14390bf8 100644 --- a/roles/ceph-defaults/defaults/main.yml +++ b/roles/ceph-defaults/defaults/main.yml @@ -334,6 +334,7 @@ cephfs_pools: ## OSD options # +lvmetad_disabled: false is_hci: false hci_safety_factor: 0.2 non_hci_safety_factor: 0.7