From dc66a5e65a4541bd509510ee8b6583e996a11d1a Mon Sep 17 00:00:00 2001 From: Rishabh Dave Date: Wed, 12 Jun 2019 14:39:44 +0530 Subject: [PATCH] ceph-infra: make chronyd default NTP daemon Since timesyncd is not available on RHEL-based OSs, change the default to chronyd for RHEL-based OSs. Also, chronyd is chrony on Ubuntu, so set the Ansible fact accordingly. Fixes: https://github.com/ceph/ceph-ansible/issues/3628 Signed-off-by: Rishabh Dave (cherry picked from commit 9d88d3199fd8c6548a56bf9e95cd9239481baa39) --- group_vars/all.yml.sample | 2 +- group_vars/rhcs.yml.sample | 2 +- roles/ceph-defaults/defaults/main.yml | 2 +- roles/ceph-facts/tasks/facts.yml | 12 ++++++++++++ roles/ceph-infra/tasks/setup_ntp.yml | 2 +- 5 files changed, 16 insertions(+), 4 deletions(-) diff --git a/group_vars/all.yml.sample b/group_vars/all.yml.sample index 305d14e2d..05ff7ea99 100644 --- a/group_vars/all.yml.sample +++ b/group_vars/all.yml.sample @@ -100,7 +100,7 @@ dummy: # Set type of NTP client daemon to use, valid entries are chronyd, ntpd or timesyncd # Note that this selection is currently ignored on containerized deployments -#ntp_daemon_type: timesyncd +#ntp_daemon_type: chronyd # Set uid/gid to default '64045' for bootstrap directories. diff --git a/group_vars/rhcs.yml.sample b/group_vars/rhcs.yml.sample index b67529cb2..68547629a 100644 --- a/group_vars/rhcs.yml.sample +++ b/group_vars/rhcs.yml.sample @@ -100,7 +100,7 @@ fetch_directory: ~/ceph-ansible-keys # Set type of NTP client daemon to use, valid entries are chronyd, ntpd or timesyncd # Note that this selection is currently ignored on containerized deployments -#ntp_daemon_type: timesyncd +#ntp_daemon_type: chronyd # Set uid/gid to default '64045' for bootstrap directories. diff --git a/roles/ceph-defaults/defaults/main.yml b/roles/ceph-defaults/defaults/main.yml index 632ffde3d..83518ca54 100644 --- a/roles/ceph-defaults/defaults/main.yml +++ b/roles/ceph-defaults/defaults/main.yml @@ -92,7 +92,7 @@ ntp_service_enabled: true # Set type of NTP client daemon to use, valid entries are chronyd, ntpd or timesyncd # Note that this selection is currently ignored on containerized deployments -ntp_daemon_type: timesyncd +ntp_daemon_type: chronyd # Set uid/gid to default '64045' for bootstrap directories. diff --git a/roles/ceph-facts/tasks/facts.yml b/roles/ceph-facts/tasks/facts.yml index 05fba0327..c6f978179 100644 --- a/roles/ceph-facts/tasks/facts.yml +++ b/roles/ceph-facts/tasks/facts.yml @@ -290,6 +290,18 @@ ntp_service_name: ntpd when: ansible_os_family in ['RedHat', 'Suse'] +- name: set chrony daemon name RedHat and Ubuntu based OSs + block: + - name: set chronyd daemon name for RedHat based OSs + set_fact: + chrony_daemon_name: chronyd + when: ansible_os_family in ["RedHat", "Suse"] + + - name: set chronyd daemon name for Ubuntu based OSs + set_fact: + chrony_daemon_name: chrony + when: ansible_os_family == "Debian" + - name: set grafana_server_addr fact set_fact: grafana_server_addr: "{{ (hostvars[groups[grafana_server_group_name][0] | default(groups[mgr_group_name][0])])['ansible_all_ipv4_addresses'] | ipaddr(public_network) | first }}" diff --git a/roles/ceph-infra/tasks/setup_ntp.yml b/roles/ceph-infra/tasks/setup_ntp.yml index 775b1367d..d246333d5 100644 --- a/roles/ceph-infra/tasks/setup_ntp.yml +++ b/roles/ceph-infra/tasks/setup_ntp.yml @@ -45,7 +45,7 @@ - name: enable chronyd service: - name: chronyd + name: "{{ chrony_daemon_name }}" enabled: yes state: started notify: