Merge "Add host prep step for ntp time sync" into stable/pike

This commit is contained in:
Zuul 2018-07-03 19:14:24 +00:00 committed by Gerrit Code Review
commit af4661905b
1 changed files with 18 additions and 1 deletions

View File

@ -46,7 +46,10 @@ parameters:
ntp will send a burst of eight packages instead of one. This
is designed to speed up the initial syncrhonization.
type: boolean
EnablePackageInstall:
default: 'false'
description: Set to true to enable package installation at deploy time
type: boolean
outputs:
role_data:
@ -62,3 +65,17 @@ outputs:
proto: udp
step_config: |
include ::tripleo::profile::base::time::ntp
host_prep_tasks:
- name: NTP settings
set_fact:
ntp_servers: {get_param: NtpServer}
ntp_install_packages: {get_param: EnablePackageInstall}
- block:
- name: Install ntpdate
package:
name: ntpdate
state: present
when: ntp_install_packages|bool
- name: Ensure system is NTP time synced
command: ntpdate -u {{ ntp_servers | join(" ") }}
when: ntp_servers