]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
ceph-infra: make chronyd default NTP daemon
authorRishabh Dave <ridave@redhat.com>
Wed, 12 Jun 2019 09:09:44 +0000 (14:39 +0530)
committerGuillaume Abrioux <gabrioux@redhat.com>
Tue, 18 Jun 2019 08:46:34 +0000 (10:46 +0200)
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 <ridave@redhat.com>
(cherry picked from commit 9d88d3199fd8c6548a56bf9e95cd9239481baa39)

group_vars/all.yml.sample
group_vars/rhcs.yml.sample
roles/ceph-defaults/defaults/main.yml
roles/ceph-facts/tasks/facts.yml
roles/ceph-infra/tasks/setup_ntp.yml

index 2ed2fb3c8c77a1d943cf282fdd05376320163827..cee636e61a5eb1bfb9b6e731b0ecd25ab4a10129 100644 (file)
@@ -105,7 +105,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.
index e7c5b5749751b92eb248ef10b9c3875578894719..e74d71479aea1c310aeaebef6a9afb7c43f1bac5 100644 (file)
@@ -105,7 +105,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.
index 3792c77355c071cbc5bbf52cc06c99ab65519b7b..3db347679560ded29f0cd840da96f06115cc6d40 100644 (file)
@@ -97,7 +97,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.
index c0c2215baba6adf787cd280822feb272a368f57a..331235463df6a98a0362e684bf250b29d8f40aa0 100644 (file)
   set_fact:
     osd_pool_default_crush_rule: "{% if crush_rule_variable.rc == 0 %}{{ crush_rule_variable.stdout.split(' = ')[1] }}{% else %}{{ ceph_osd_pool_default_crush_rule }}{% endif %}"
   when: ceph_conf.stat.exists
+
+- name: set ntp service name depending on OS family
+  block:
+  - name: set ntp service name for Debian family
+    set_fact:
+      ntp_service_name: ntp
+    when: ansible_os_family == 'Debian'
+
+  - name: set ntp service name for Red Hat family
+    set_fact:
+      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"
index c46d57de786bb1fdffd302cb10478feef99f6e7c..933a0d198a5cd9d0c5fbcc4c5e682331f3ff2316 100644 (file)
@@ -61,7 +61,7 @@
 
     - name: enable chronyd
       service:
-        name: chronyd
+        name: "{{ chrony_daemon_name }}"
         enabled: yes
         state: started
       notify: