# - ntp
# - python-setuptools
+# Enable the ntp service by default to avoid clock skew on
+# ceph nodes
+#ntp_service_enabled: true
# The list of ceph packages needed for debian.
# This variable should only be changed if packages are not available from a given
- ntp
- python-setuptools
+# Enable the ntp service by default to avoid clock skew on
+# ceph nodes
+ntp_service_enabled: true
# The list of ceph packages needed for debian.
# This variable should only be changed if packages are not available from a given
--- /dev/null
+---
+- name: check ntp installation on debian
+ command: dpkg -s ntp
+ register: ntp_pkg_query
+ ignore_errors: true
+ changed_when: false
+ when: ansible_os_family == 'Debian'
--- /dev/null
+---
+- name: check ntp installation on redhat
+ command: rpm -q ntp
+ register: ntp_pkg_query
+ ignore_errors: true
+ changed_when: false
+ when: ansible_os_family == 'RedHat'
tags:
- package-install
+- include: ./misc/ntp_redhat.yml
+ when:
+ - ansible_os_family == 'RedHat'
+ - ntp_service_enabled
+
+- include: ./misc/ntp_debian.yml
+ when:
+ - ansible_os_family == 'Debian'
+ - ntp_service_enabled
+
- include: facts.yml
- set_fact:
--- /dev/null
+---
+- include: ../checks/check_ntp_debian.yml
+ when: ansible_os_family == 'Debian'
+
+- name: start the ntp service
+ service:
+ name: ntp
+ enabled: yes
+ state: started
+ when:
+ - ntp_pkg_query.rc == 0
--- /dev/null
+---
+- include: ../checks/check_ntp_redhat.yml
+ when: ansible_os_family == 'RedHat'
+
+- name: start the ntp service
+ service:
+ name: ntpd
+ enabled: yes
+ state: started
+ when:
+ - ntp_pkg_query.rc == 0