Skip to content
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 config to set which interface ntp should listen #14

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions roles/kubernetes/preinstall/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@ ntp_servers:
ntp_restrict:
- "127.0.0.1"
- "::1"
# Specify whether to filter interfaces
ntp_filter_interface: false
# Specify the interfaces
# Only takes effect when ntp_filter_interface is true
ntp_interfaces:
- ens3
# The NTP driftfile path
# Only takes effect when ntp_manage_config is true.
ntp_driftfile: /var/lib/ntp/ntp.drift
Expand Down
7 changes: 7 additions & 0 deletions roles/kubernetes/preinstall/templates/ntp.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ restrict -6 default kod notrap nomodify nopeer noquery limited
restrict {{ item }}
{% endfor %}

{% if ntp_filter_interface %}
interface ignore wildcard
{% for item in ntp_listen %}
interface listen {{ item }}
{% endfor %}
Pavan-Gunda marked this conversation as resolved.
Show resolved Hide resolved
{% endif %}

# Needed for adding pool entries
restrict source notrap nomodify noquery

Expand Down