-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NTP] Add NTP extended configuration #15058
Changes from 10 commits
46c61d1
e0fa6a7
235e111
4d271f4
f4e8278
1171ae4
3f6a693
6f46ee7
ee6ee4d
2cbcae9
0537a0a
80fa802
eac4a88
f721615
69742ff
f911928
82152b0
b693790
d9ac8e8
30b1685
63a830a
a4df615
97d19e7
63c3dd0
5eadcfa
99e779d
f2edb44
64b3040
5a16d6d
403d1da
e2e8d97
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
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}} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you please also add an example of ntp.keys where trusted_str is not empty? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I will attach it here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here is the example:
Ip addresses here are trusted servers |
||
{% endfor -%} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can
ExecCondition=
in the systemd service file be used to check this condition instead? That way the service status will accurately reflect that a condition check failed.There also shoudn't be another ntp daemon running at this point of time, so there shouldn't be anything that needs to be stopped.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm. nice idea, I guess it will work. I will try it and let you know the result here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any update here on whether this worked?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey. I tried it with another daemon and it actually works fine. I tried to rework it here, but it won't work here in a couple of reasons:
ExecStopPost
condition to stop the daemon.Other reasons I don't like this option:
ntp-systemd-wrapper
script was created exactly to customize the control of ntp daemon.So I would like to avoid of such changes