Commit 84395ae7 authored by Chris Coley's avatar Chris Coley
Browse files

Fix an issue where a default restrict rule for pools only works on NTP v4.2.7p22 or later

parent 91bdae96
......@@ -29,6 +29,15 @@
register: _ntp__installed
become: true
- name: Get version of the installed NTP package
shell: "ntpd --version 2>&1 | head -n 1 | cut -d' ' -f2 | cut -d'@' -f1"
register: _ntp__version
changed_when: false
- set_fact:
_ntp__version: '{{ _ntp__version.stdout }}'
#- debug:
# var: _ntp__version
- name: Generate the NTP configuration file
template:
src: '{{ role_path }}/templates/ntp.conf.j2'
......
......@@ -31,8 +31,10 @@ restrict -6 default ignore
restrict {{ restriction }}
{% endfor %}
{% if _ntp__version is version_compare('4.2.7p22', '>=') %}
# Needed for adding pool entries
restrict source notrap nomodify noquery
{% endif %}
# Add the ntp servers. You generally don't need these if you're using a pool.
# server 0.pool.ntp.org iburst
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment