Add host prep step for ntp time sync
Docker doesn't like it when the time shifts so if we're building containers when the ntp time sync actually occurs it can lead to deployment failures. To prevent this, let's force a ntpdate on the host during step1 to ensure the hardware time is properly synced before proceeding. Change-Id: I812c7da90ae06120707fd8795a41e4fd867f510e Closes-Bug: #1776869
This commit is contained in:
parent
4286727ae7
commit
a866f55691
|
@ -64,7 +64,10 @@ parameters:
|
||||||
default: 6
|
default: 6
|
||||||
constraints:
|
constraints:
|
||||||
- range: { min: 4, max: 17 }
|
- range: { min: 4, max: 17 }
|
||||||
|
EnablePackageInstall:
|
||||||
|
default: 'false'
|
||||||
|
description: Set to true to enable package installation at deploy time
|
||||||
|
type: boolean
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
role_data:
|
role_data:
|
||||||
|
@ -82,3 +85,17 @@ outputs:
|
||||||
proto: udp
|
proto: udp
|
||||||
step_config: |
|
step_config: |
|
||||||
include ::tripleo::profile::base::time::ntp
|
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
|
||||||
|
|
Loading…
Reference in New Issue