Remove ValidateNtp

We already do this in the time configuration and it is no longer a
configurable item due to containers. Let's stop doing this in the all
nodes validation and let the time configuration handle the failure
messaging.

Change-Id: Ib0abcbd25117ecd587f4a92698746e5e256e6e8e
This commit is contained in:
Alex Schultz 2020-05-27 15:04:26 -06:00 committed by Emilien Macchi
parent 73938d3913
commit ed2df1a05f
5 changed files with 8 additions and 58 deletions

View File

@ -22,10 +22,6 @@ parameters:
default: false
description: Optional validation to ensure FQDN as set by Nova matches the name set in /etc/hosts.
type: boolean
ValidateNtp:
default: true
description: Validation to ensure at least one time source is accessible.
type: boolean
resources:
AllNodesValidationsImpl:
@ -37,8 +33,6 @@ resources:
default: {get_param: PingTestIps}
- name: validate_fqdn
default: {get_param: ValidateFqdn}
- name: validate_ntp
default: {get_param: ValidateNtp}
- name: validate_controllers_icmp
default: {get_param: ValidateControllersIcmp}
- name: validate_gateways_icmp

View File

@ -16,10 +16,6 @@ parameters:
default: false
description: Optional validation to ensure FQDN as set by Nova matches the name set in /etc/hosts.
type: boolean
ValidateNtp:
default: true
description: Validation to ensure at least one time source is accessible.
type: boolean
resources:
AllNodesValidationsImpl:
@ -31,8 +27,6 @@ resources:
default: {get_param: PingTestIps}
- name: validate_fqdn
default: {get_param: ValidateFqdn}
- name: validate_ntp
default: {get_param: ValidateNtp}
config: |
#!/bin/bash
exit 0

View File

@ -136,10 +136,6 @@ parameters:
default: false
description: Optional validation to ensure FQDN as set by Nova matches the name set in /etc/hosts.
type: boolean
ValidateNtp:
default: true
description: Validation to ensure at least one time source is accessible.
type: boolean
PingTestIpsMap:
default: ''
description: A map of role name to a space separated list of IP addresses used to ping test each available network interface.
@ -360,7 +356,6 @@ outputs:
validate_controllers_icmp: {get_param: ValidateControllersIcmp}
validate_gateways_icmp: {get_param: ValidateGatewaysIcmp}
validate_fqdn: {get_param: ValidateFqdn}
validate_ntp: {get_param: ValidateNtp}
ping_test_ips: {get_param: PingTestIpsMap}
stack_action: {get_param: StackAction}
deploy_artifact_urls: {list_join: [' ', {get_param: DeployArtifactURLs}]}
@ -631,7 +626,6 @@ outputs:
validate_controllers_icmp: "{{ validate_controllers_icmp }}"
validate_gateways_icmp: "{{ validate_gateways_icmp }}"
validate_fqdn: "{{ validate_fqdn }}"
validate_ntp: "{{ validate_ntp }}"
ping_test_ips: "{{ ping_test_ips | to_json }}"
tripleo_role_name: "{{ tripleo_role_name }}"

View File

@ -0,0 +1,8 @@
---
other:
- |
The ValidateNtp has been removed from the all nodes validation configuration.
During the time sync configuration we already do a check to ensure the ntp
servers are available. If they are not we will fail with an appropriate message.
The ValidateNtp option came from a time before we could fail in a more
explicit way.

View File

@ -88,43 +88,6 @@ function fqdn_check() {
echo "SUCCESS"
}
# run chrony/ntpdate as available
function _run_ntp_sync() {
local NTP_SERVER=$1
if ! type ntpdate 2>/dev/null; then
chronyd -Q "server $NTP_SERVER iburst"
else
ntpdate -qud $NTP_SERVER
fi
}
# Verify at least one time source is available.
function ntp_check() {
NTP_SERVERS=$(hiera ntp::servers nil |tr -d '[],"')
if [[ "$NTP_SERVERS" != "nil" ]];then
echo -n "Testing NTP..."
NTP_SUCCESS=0
for NTP_SERVER in $NTP_SERVERS; do
set +e
NTPDATE_OUT=$(_run_ntp_sync $NTP_SERVER 2>&1)
NTPDATE_EXIT=$?
set -e
if [[ "$NTPDATE_EXIT" == "0" ]];then
NTP_SUCCESS=1
break
else
NTPDATE_OUT_FULL="$NTPDATE_OUT_FULL $NTPDATE_OUT"
fi
done
if [[ "$NTP_SUCCESS" == "0" ]];then
echo "FAILURE"
echo "$NTPDATE_OUT_FULL"
exit 1
fi
echo "SUCCESS"
fi
}
if [[ "${validate_gateways_icmp,,}" == "true" ]];then
ping_default_gateways
fi
@ -134,6 +97,3 @@ fi
if [[ "${validate_fqdn,,}" == "true" ]];then
fqdn_check
fi
if [[ "${validate_ntp,,}" == "true" ]];then
ntp_check
fi