From bb2c125a4fa7444af33fbd9ee5e64b52208b7519 Mon Sep 17 00:00:00 2001 From: Teoman ONAY Date: Fri, 24 Nov 2023 18:28:11 +0100 Subject: [PATCH] Keep chrony installed when purging a cluster Chrony is mandatory on a ceph node but could be already present before installing Ceph. At Ceph uninstallation, we will keep it installed but this behavior can be changed by changing the "keep_chrony_installed" variable. Fixes: https://github.com/ceph/cephadm-ansible/issues/239 Signed-off-by: Teoman ONAY --- ceph_defaults/defaults/main.yml | 1 + cephadm-purge-cluster.yml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ceph_defaults/defaults/main.yml b/ceph_defaults/defaults/main.yml index 29b62dd..56582bb 100644 --- a/ceph_defaults/defaults/main.yml +++ b/ceph_defaults/defaults/main.yml @@ -20,3 +20,4 @@ ceph_client_pkgs: - chrony - ceph-common client_group: clients +keep_chrony_installed: true diff --git a/cephadm-purge-cluster.yml b/cephadm-purge-cluster.yml index 725883d..5785c24 100644 --- a/cephadm-purge-cluster.yml +++ b/cephadm-purge-cluster.yml @@ -155,7 +155,7 @@ - name: remove ceph packages package: - name: "{{ 'ceph-common' if group_names == [client_group] else ceph_pkgs | unique }}" + name: "{{ 'ceph-common' if group_names == [client_group] else (keep_chrony_installed | ternary(ceph_pkgs | difference('chrony'), ceph_pkgs)) | unique }}" state: absent register: result until: result is succeeded