Add option to enable ntp

This fixes: #845 only for non-containerized deployments

Signed-off-by: Ivan Font <ivan.font@redhat.com>
pull/848/head
Ivan Font 2016-06-09 18:32:55 -07:00
parent 08af355161
commit 453c299ed7
7 changed files with 52 additions and 0 deletions

View File

@ -64,6 +64,9 @@ dummy:
# - ntp # - ntp
# - python-setuptools # - 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. # The list of ceph packages needed for debian.
# This variable should only be changed if packages are not available from a given # This variable should only be changed if packages are not available from a given

View File

@ -56,6 +56,9 @@ redhat_package_dependencies:
- ntp - ntp
- python-setuptools - 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. # The list of ceph packages needed for debian.
# This variable should only be changed if packages are not available from a given # This variable should only be changed if packages are not available from a given

View File

@ -0,0 +1,7 @@
---
- 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'

View File

@ -0,0 +1,7 @@
---
- 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'

View File

@ -71,6 +71,16 @@
tags: tags:
- package-install - 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 - include: facts.yml
- set_fact: - set_fact:

View File

@ -0,0 +1,11 @@
---
- 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

View File

@ -0,0 +1,11 @@
---
- 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