-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[202311][cherry-pick][NTP] Add NTP extended configuration (#17487)
* Add NTP YANG model Signed-off-by: Yevhen Fastiuk <[email protected]> * Extend NTP config generation mechanism Signed-off-by: Yevhen Fastiuk <[email protected]> * Add NTP YANG nodel tests Signed-off-by: Yevhen Fastiuk <[email protected]> * Add test for NTP Jinja templates Signed-off-by: Yevhen Fastiuk <[email protected]> * Add ntpdate package Signed-off-by: Yevhen Fastiuk <[email protected]> * Fix 'bad' when auth disabled Signed-off-by: Yevhen Fastiuk <[email protected]> * [NTP] Changed owner for ntp keys config file to root and remove read access for other. Signed-off-by: Yevhen Fastiuk <[email protected]> * Fix NTP warnings after restarting the service Signed-off-by: Yevhen Fastiuk <[email protected]> * Add ability to encrypt/decrypt NTP keys Signed-off-by: Yevhen Fastiuk <[email protected]> * Update Configuration reference Signed-off-by: Yevhen Fastiuk <[email protected]> * Fix NTP configuration template * Align the description for setting interface * Fix the usage of scoped variable Signed-off-by: Yevhen Fastiuk <[email protected]> * Fix YANG model description and tests Signed-off-by: Yevhen Fastiuk <[email protected]> * Align NTP test according to fixed condition Signed-off-by: Yevhen Fastiuk <[email protected]> * Allow eth0 to be as source ifc without defining it Signed-off-by: Yevhen Fastiuk <[email protected]> * Update sample config with NTP config Signed-off-by: Yevhen Fastiuk <[email protected]> --------- Signed-off-by: Yevhen Fastiuk <[email protected]>
- Loading branch information
Showing
21 changed files
with
891 additions
and
282 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
############################################################################### | ||
# This file was AUTOMATICALLY GENERATED. DO NOT MODIFY. | ||
# Controlled by ntp-config.service | ||
############################################################################### | ||
|
||
{# We can connect only to the servers we trust. Determine those servers -#} | ||
{% set trusted_arr = [] -%} | ||
{% for server in NTP_SERVER if NTP_SERVER[server].trusted == 'yes' and | ||
NTP_SERVER[server].resolve_as -%} | ||
{% set _ = trusted_arr.append(NTP_SERVER[server].resolve_as) -%} | ||
{% endfor -%} | ||
|
||
{# Define authentication keys inventory -#} | ||
{% set trusted_str = ' ' ~ trusted_arr|join(',') -%} | ||
{% for keyid in NTP_KEY if NTP_KEY[keyid].type and NTP_KEY[keyid].value %} | ||
{% set keyval = NTP_KEY[keyid].value | b64decode %} | ||
{{ keyid }} {{ NTP_KEY[keyid].type }} {{ keyval }}{{trusted_str}} | ||
{% endfor -%} |
Oops, something went wrong.