From a27761855bb3c4d8638a0000a59d0f24f810a92f 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 c5f5a13e47..7ab9408959 100644 --- a/group_vars/all.yml.sample +++ b/group_vars/all.yml.sample @@ -368,6 +368,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 5642c954be..a9e7211e25 100644 --- a/group_vars/rhcs.yml.sample +++ b/group_vars/rhcs.yml.sample @@ -368,6 +368,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 c7761c311f..1baf96a055 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 191c4127e4..3ee5673fa8 100644 --- a/roles/ceph-defaults/defaults/main.yml +++ b/roles/ceph-defaults/defaults/main.yml @@ -360,6 +360,7 @@ cephfs_pools: ## OSD options # +lvmetad_disabled: false is_hci: false hci_safety_factor: 0.2 non_hci_safety_factor: 0.7