From 360e0107a740a2dcdca98e75cb12cd9af39eebb1 Mon Sep 17 00:00:00 2001 From: David Shrewsbury Date: Wed, 22 Aug 2018 14:41:11 -0400 Subject: [PATCH] Add NTP service to base-server Removes puppet-side ntp setup. Change-Id: I75a87ca55fd4b75c5715cc3fd2b708e0b0ae2c20 --- modules/openstack_project/manifests/server.pp | 5 ----- playbooks/roles/base-server/defaults/main.yaml | 1 + playbooks/roles/base-server/tasks/main.yaml | 6 ++++++ playbooks/roles/base-server/vars/Debian.yaml | 1 + playbooks/roles/base-server/vars/RedHat.yaml | 1 + playbooks/roles/base-server/vars/Ubuntu.trusty.yaml | 1 + 6 files changed, 10 insertions(+), 5 deletions(-) diff --git a/modules/openstack_project/manifests/server.pp b/modules/openstack_project/manifests/server.pp index c5d001ceb3..0e6066199d 100644 --- a/modules/openstack_project/manifests/server.pp +++ b/modules/openstack_project/manifests/server.pp @@ -19,11 +19,6 @@ class openstack_project::server ( include ::apt } - ########################################################### - # Manage ntp - - include '::ntp' - ########################################################### # Process if ( $high_level_directive ) blocks diff --git a/playbooks/roles/base-server/defaults/main.yaml b/playbooks/roles/base-server/defaults/main.yaml index 570a19838f..dbc13b26c3 100644 --- a/playbooks/roles/base-server/defaults/main.yaml +++ b/playbooks/roles/base-server/defaults/main.yaml @@ -5,6 +5,7 @@ base_packages: - at - git - lvm2 + - ntp - openssh-server - parted - rsync diff --git a/playbooks/roles/base-server/tasks/main.yaml b/playbooks/roles/base-server/tasks/main.yaml index 2ccbf01ca1..fd14067d1e 100644 --- a/playbooks/roles/base-server/tasks/main.yaml +++ b/playbooks/roles/base-server/tasks/main.yaml @@ -60,6 +60,12 @@ src: bash-history.sh dest: /etc/profile.d/bash-history.sh +- name: Ensure NTP service is running + service: + name: "{{ ntp_service_name }}" + enabled: yes + state: started + - name: Include OS-specific tasks include_tasks: "{{ lookup('first_found', file_list) }}" vars: diff --git a/playbooks/roles/base-server/vars/Debian.yaml b/playbooks/roles/base-server/vars/Debian.yaml index 3df5c620b0..a66551d829 100644 --- a/playbooks/roles/base-server/vars/Debian.yaml +++ b/playbooks/roles/base-server/vars/Debian.yaml @@ -5,3 +5,4 @@ distro_packages: - vim-nox sftp_path: /usr/lib/openssh/sftp-server ssh_service_name: ssh +ntp_service_name: ntp diff --git a/playbooks/roles/base-server/vars/RedHat.yaml b/playbooks/roles/base-server/vars/RedHat.yaml index b787d335bd..ce56b09ccf 100644 --- a/playbooks/roles/base-server/vars/RedHat.yaml +++ b/playbooks/roles/base-server/vars/RedHat.yaml @@ -11,3 +11,4 @@ distro_packages: - yum-cron sftp_path: /usr/libexec/openssh/sftp-server ssh_service_name: sshd +ntp_service_name: ntpd diff --git a/playbooks/roles/base-server/vars/Ubuntu.trusty.yaml b/playbooks/roles/base-server/vars/Ubuntu.trusty.yaml index b9c4325a2f..4083e0f933 100644 --- a/playbooks/roles/base-server/vars/Ubuntu.trusty.yaml +++ b/playbooks/roles/base-server/vars/Ubuntu.trusty.yaml @@ -5,3 +5,4 @@ distro_packages: - vim-nox sftp_path: /usr/lib/openssh/sftp-server ssh_service_name: ssh +ntp_service_name: ntp