From 6fa757d34358e90ae3a2f035b50d319193521ec5 Mon Sep 17 00:00:00 2001 From: Rishabh Dave Date: Wed, 12 Dec 2018 16:53:23 +0530 Subject: [PATCH] ceph-infra: disable unrequired NTP services When one of the currently supported NTP services has been set up, disable rest of the NTP services on Ceph nodes. Signed-off-by: Rishabh Dave --- roles/ceph-infra/handlers/main.yml | 23 ++++++++++++++++++++++- roles/ceph-infra/tasks/setup_ntp.yml | 9 +++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/roles/ceph-infra/handlers/main.yml b/roles/ceph-infra/handlers/main.yml index 49fb8e843..0478dd054 100644 --- a/roles/ceph-infra/handlers/main.yml +++ b/roles/ceph-infra/handlers/main.yml @@ -3,4 +3,25 @@ service: name: firewalld state: restarted - enabled: yes \ No newline at end of file + enabled: yes + +- name: disable ntpd + failed_when: false + service: + name: ntpd + state: stopped + enabled: no + +- name: disable chronyd + failed_when: false + service: + name: chronyd + enabled: no + state: stopped + +- name: disable timesyncd + failed_when: false + service: + name: timesyncd + enabled: no + state: stopped diff --git a/roles/ceph-infra/tasks/setup_ntp.yml b/roles/ceph-infra/tasks/setup_ntp.yml index b6a2ce34a..cb2a89aa5 100644 --- a/roles/ceph-infra/tasks/setup_ntp.yml +++ b/roles/ceph-infra/tasks/setup_ntp.yml @@ -15,6 +15,9 @@ - name: install and enable timesyncd command: timedatectl set-ntp on when: ntp_daemon_type == "timesyncd" + notify: + - disable ntpd + - disable chronyd - name: disable time sync using timesyncd if we are not using it command: timedatectl set-ntp no @@ -34,6 +37,9 @@ name: "{{ ntp_service_name }}" enabled: yes state: started + notify: + - disable chronyd + - disable timesyncd - name: setup chronyd when: ntp_daemon_type == "chronyd" @@ -49,3 +55,6 @@ name: chronyd enabled: yes state: started + notify: + - disable chronyd + - disable timesyncd -- 2.39.5