Merge pull request #848 from font/master

Add option to enable ntp
pull/888/head
Leseb 2016-07-18 18:24:54 +02:00 committed by GitHub
commit 48599c07cc
7 changed files with 52 additions and 0 deletions

View File

@ -65,6 +65,9 @@ dummy:
# - 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

View File

@ -57,6 +57,9 @@ redhat_package_dependencies:
- 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

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

@ -73,6 +73,16 @@
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:

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